Issue #57, conver the document image queue maintenance view into a celery task
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user