Issue #57, conver the document image queue maintenance view into a celery task

This commit is contained in:
Roberto Rosario
2014-10-22 18:21:40 -04:00
parent 5229b9e9e0
commit f86be42dd0
2 changed files with 12 additions and 6 deletions
+9
View File
@@ -11,3 +11,12 @@ logger = logging.getLogger(__name__)
def task_get_document_image(document_id, *args, **kwargs):
document = Document.objects.get(pk=document_id)
return document.get_image(*args, **kwargs)
@app.task
def task_clear_image_cache():
# TODO: Error logging
#try:
Document.clear_image_cache()
# except Exception as exception:
# messages.error(request, _(u'Error clearing document image cache; %s') % exception)