parent
1c8f52daee
commit
fbb3ee5041
@ -113,9 +113,7 @@ user_privilege_scheme = string(default="uploader,commenter,reporter")
|
|||||||
|
|
||||||
# Frequency garbage collection will run (setting to 0 or false to disable)
|
# Frequency garbage collection will run (setting to 0 or false to disable)
|
||||||
# Setting units are minutes.
|
# Setting units are minutes.
|
||||||
## NOTE: This is temporarily disabled, but we want to set it back:
|
garbage_collection = integer(default=60)
|
||||||
## garbage_collection = integer(default=60)
|
|
||||||
garbage_collection = integer(default=0)
|
|
||||||
|
|
||||||
[jinja2]
|
[jinja2]
|
||||||
# Jinja2 supports more directives than the minimum required by mediagoblin.
|
# Jinja2 supports more directives than the minimum required by mediagoblin.
|
||||||
|
@ -155,5 +155,19 @@ class ProcessMedia(celery.Task):
|
|||||||
|
|
||||||
entry = mgg.database.MediaEntry.query.filter_by(id=entry_id).first()
|
entry = mgg.database.MediaEntry.query.filter_by(id=entry_id).first()
|
||||||
json_processing_callback(entry)
|
json_processing_callback(entry)
|
||||||
|
mgg.database.reset_after_request()
|
||||||
|
|
||||||
|
def after_return(self, *args, **kwargs):
|
||||||
|
"""
|
||||||
|
This is called after the task has returned, we should clean up.
|
||||||
|
|
||||||
|
We need to rollback the database to prevent ProgrammingError exceptions
|
||||||
|
from being raised.
|
||||||
|
"""
|
||||||
|
# In eager mode we get DetachedInstanceError, we do rollback on_failure
|
||||||
|
# to deal with that case though when in eager mode.
|
||||||
|
if not celery.app.default_app.conf['CELERY_ALWAYS_EAGER']:
|
||||||
|
mgg.database.reset_after_request()
|
||||||
|
|
||||||
|
|
||||||
tasks.register(ProcessMedia)
|
tasks.register(ProcessMedia)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user