File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,11 @@ HOME=/home/django/your-app
1591590 1 * * * root python manage.py cleanup_http_uploads
160160```
161161
162+ ### celery task
163+
164+ Alternatively, if you use [ Celery] ( http://www.celeryproject.org/ ) , you can also use the
165+ `` xmpp_http_upload.cleanup_http_uploads `` task to cleanup your files.
166+
162167## Development
163168
164169If you want to use this app to develop e.g. a plugin for an XMPP server, you can simply do the
Original file line number Diff line number Diff line change 1+ # -*- coding: utf-8 -*-
2+ #
3+ # This file is part of django-xmpp-http-upload
4+ # (https://github.com/mathiasertl/django-xmpp-http-upload).
5+ #
6+ # django-xmpp-http-upload is free software: you can redistribute it and/or modify it under the
7+ # terms of the GNU General Public License as published by the Free Software Foundation, either
8+ # version 3 of the License, or (at your option) any later version.
9+ #
10+ # django-xmpp-http-upload is distributed in the hope that it will be useful, but WITHOUT ANY
11+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12+ # PURPOSE. See the GNU General Public License for more details.
13+ #
14+ # You should have received a copy of the GNU General Public License along with
15+ # django-xmpp-http-upload. If not, see <http://www.gnu.org/licenses/>.
16+
17+ from celery import shared_task
18+
19+ from .models import Upload
20+
21+
22+ @shared_task
23+ def cleanup_http_uploads (slots = True , files = True , timeout = None ):
24+ Upload .objects .cleanup (slots = slots , files = files , timeout = timeout )
You can’t perform that action at this time.
0 commit comments