Update apps interface for the new LocalScheduler class

This commit is contained in:
Roberto Rosario
2012-08-01 01:43:00 -04:00
parent 859109c378
commit 344e738c48
8 changed files with 37 additions and 24 deletions
+5 -2
View File
@@ -2,7 +2,7 @@ from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from scheduler.api import register_interval_job
from scheduler.api import LocalScheduler
from navigation.api import bind_links, register_model_list_columns
from project_tools.api import register_tool
from common.utils import encapsulate
@@ -14,9 +14,12 @@ from .tasks import job_queue_poll
from .links import (node_workers, job_queues, tool_link,
job_queue_items_pending, job_queue_items_error, job_queue_items_active)
#TODO: fix this, make it cluster wide
JOB_QUEUE_POLL_INTERVAL = 1
register_interval_job('job_queue_poll', _(u'Poll a job queue for pending jobs.'), job_queue_poll, seconds=JOB_QUEUE_POLL_INTERVAL)
job_processor_scheduler = LocalScheduler('job_processor', _(u'Job processor'))
job_processor_scheduler.add_interval_job('job_queue_poll', _(u'Poll a job queue for pending jobs.'), job_queue_poll, seconds=JOB_QUEUE_POLL_INTERVAL)
job_processor_scheduler.start()
register_tool(tool_link)
bind_links([JobQueue, 'job_queues'], [job_queues], menu_name='secondary_menu')