[virtualcommons-svn] commit/vcweb: alllee: adding simple celery configuration using the default dja
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2011-06-30 18:31:57
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/b0acb3ca37c5/ changeset: b0acb3ca37c5 user: alllee date: 2011-06-30 20:31:53 summary: adding simple celery configuration using the default django database instead of a rabbitmq broker affected #: 4 files (293 bytes) --- a/vcweb/core/signals.py Wed Jun 29 15:38:03 2011 -0700 +++ b/vcweb/core/signals.py Thu Jun 30 11:31:53 2011 -0700 @@ -5,6 +5,7 @@ round_started = Signal(providing_args=["experiment", 'time', 'round_configuration']) round_ended = Signal(providing_args=['experiment', 'time', 'round_configuration']) minute_tick = Signal(providing_args=['time']) +hour_tick = Signal(providing_args=['time']) post_login = Signal(providing_args=['user']) post_logout = Signal(providing_args=['user']) --- a/vcweb/core/tasks.py Wed Jun 29 15:38:03 2011 -0700 +++ b/vcweb/core/tasks.py Thu Jun 30 11:31:53 2011 -0700 @@ -2,17 +2,14 @@ from datetime import datetime, timedelta from vcweb.core import signals -''' -The updater module is invoked periodically from an external process to set up the -signaling and timing / processing of experiments in progress. - -@author: alllee -''' - @periodic_task(run_every=timedelta(seconds=60), ignore_result=True) def every_minute(): + ''' + Celery task invoked periodically from celerybeat. + ''' # use signal or just update experiment instance models directly here? signals.minute_tick.send(sender=None, time=datetime.now()) - - +@periodic_task(run_every=timedelta(seconds=3600), ignore_result=True) +def every_hour(): + signals.hour_tick.send(sender=None, time=datetime.now()) --- a/vcweb/fabfile.py Wed Jun 29 15:38:03 2011 -0700 +++ b/vcweb/fabfile.py Thu Jun 30 11:31:53 2011 -0700 @@ -102,10 +102,7 @@ local("{python} manage.py runserver {ip}:{port}".format(python=env.python, **locals()), capture=False) def celeryd(): - local("%(python)s manage.py celeryd" % env) - -def celerybeat(): - local("%(python)s manage.py celerybeat" % env) + local("%(python)s manage.py celeryd -B" % env) def push(): local('hg push ssh://hg...@bi.../virtualcommons/vcweb') --- a/vcweb/settings.py Wed Jun 29 15:38:03 2011 -0700 +++ b/vcweb/settings.py Thu Jun 30 11:31:53 2011 -0700 @@ -113,7 +113,9 @@ # socket.io configuration SOCKET_IO_PORT = 8882; -# celery rabbitmq/amqp configuration +# celery configuration +BROKER_BACKEND = "djkombu.transport.DatabaseTransport" +# rabbitmq/amqp celery config BROKER_HOST = "localhost" BROKER_PORT = 5672 BROKER_USER = "vcweb" @@ -121,6 +123,7 @@ BROKER_VHOST = "vcweb.vhost" # celerybeat configuration +CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler' CELERYBEAT_MAX_LOOP_INTERVAL = 5 CELERYBEAT_LOG_FILE = 'celerybeat.log' CELERYBEAT_LOG_LEVEL = 'ERROR' Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |