Commit e29e2e6c authored by Leo Pound Singer's avatar Leo Pound Singer
Browse files

Fix registration of periodic tasks

According to,
since we are adding periodic tasks in a callback in a task module,
we need to use the `on_after_finalize` signal, rather than

I also had to make some small changes to the app finalization that
I worked out by trial and error.

Fixes #363.
parent 3addadd3
......@@ -17,7 +17,7 @@ __version__ = get_versions()['version']
del get_versions
# Use redis broker, because it supports locks (and thus singleton tasks).
app = Celery(__name__, broker='redis://', autofinalize=False)
app = Celery(__name__, broker='redis://', config_source=playground)
"""Celery application object."""
# Register email, LVAlert and VOEvent subsystems.
......@@ -28,10 +28,6 @@ voevent.install(app)
# Register all tasks.
# Add default configuration.
# Customize configuration from environment variable.
app.config_from_envvar('CELERY_CONFIG_MODULE', silent=True)
......@@ -143,7 +143,7 @@ def _upload_psd(graceid):
gracedb.upload(psd, 'psd.xml.gz', graceid, 'Noise PSD', ['psd'])
def setup_periodic_tasks(sender, **kwargs):
"""Register periodic tasks.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment