PEP8 cleanups, remove unused imports, add missing imports
This commit is contained in:
@@ -38,7 +38,7 @@ class Job(object):
|
||||
# OR launch 2 processes: monitor & actual process
|
||||
node = Node.objects.myself()
|
||||
worker, created = Worker.objects.get_or_create(node=node, pid=os.getpid())
|
||||
worker.job_queue_item=job_queue_item
|
||||
worker.job_queue_item = job_queue_item
|
||||
worker.save()
|
||||
try:
|
||||
transaction.commit_on_success(function)(**loads(job_queue_item.kwargs))
|
||||
@@ -248,7 +248,7 @@ class JobQueueItem(models.Model):
|
||||
at_top: requeue at the top of the file usually for jobs that
|
||||
die and shouldn't be placed at the bottom of the queue
|
||||
"""
|
||||
if self.is_in_error_state or force==True:
|
||||
if self.is_in_error_state or force == True:
|
||||
# TODO: raise exception if not in error state
|
||||
self.state = JOB_STATE_PENDING
|
||||
if not at_top:
|
||||
|
||||
@@ -5,7 +5,7 @@ urlpatterns = patterns('job_processor.views',
|
||||
url(r'^node/(?P<node_pk>\d+)/workers/$', 'node_workers', (), 'node_workers'),
|
||||
url(r'^queue/list/$', 'job_queues', (), 'job_queues'),
|
||||
url(r'^queue/(?P<job_queue_pk>\d+)/items/pending/$', 'job_queue_items', {'pending_jobs': True}, 'job_queue_items_pending'),
|
||||
url(r'^queue/(?P<job_queue_pk>\d+)/items/error/$', 'job_queue_items', {'error_jobs' :True}, 'job_queue_items_error'),
|
||||
url(r'^queue/(?P<job_queue_pk>\d+)/items/error/$', 'job_queue_items', {'error_jobs': True}, 'job_queue_items_error'),
|
||||
url(r'^queue/(?P<job_queue_pk>\d+)/items/active/$', 'job_queue_items', {'active_jobs' :True}, 'job_queue_items_active'),
|
||||
url(r'^queue/(?P<job_queue_pk>\d+)/start/$', 'job_queue_start', (), 'job_queue_start'),
|
||||
url(r'^queue/(?P<job_queue_pk>\d+)/stop/$', 'job_queue_stop', (), 'job_queue_stop'),
|
||||
|
||||
Reference in New Issue
Block a user