mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 04:38:11 +08:00
added to translations
fixed _ conflict
This commit is contained in:
+5
-5
@@ -207,7 +207,7 @@ class Sentinel(object):
|
|||||||
self.pool = []
|
self.pool = []
|
||||||
Stat(self).save()
|
Stat(self).save()
|
||||||
# spawn worker pool
|
# spawn worker pool
|
||||||
for _ in range(self.pool_size):
|
for __ in range(self.pool_size):
|
||||||
self.spawn_worker()
|
self.spawn_worker()
|
||||||
# spawn auxiliary
|
# spawn auxiliary
|
||||||
self.monitor = self.spawn_monitor()
|
self.monitor = self.spawn_monitor()
|
||||||
@@ -254,7 +254,7 @@ class Sentinel(object):
|
|||||||
def stop(self):
|
def stop(self):
|
||||||
Stat(self).save()
|
Stat(self).save()
|
||||||
name = current_process().name
|
name = current_process().name
|
||||||
logger.info('{} stopping cluster processes'.format(name))
|
logger.info(_('{} stopping cluster processes').format(name))
|
||||||
# Stopping pusher
|
# Stopping pusher
|
||||||
self.event_out.set()
|
self.event_out.set()
|
||||||
# Wait for it to stop
|
# Wait for it to stop
|
||||||
@@ -262,7 +262,7 @@ class Sentinel(object):
|
|||||||
sleep(0.1)
|
sleep(0.1)
|
||||||
Stat(self).save()
|
Stat(self).save()
|
||||||
# Put poison pills in the queue
|
# Put poison pills in the queue
|
||||||
for _ in range(len(self.pool)):
|
for __ in range(len(self.pool)):
|
||||||
self.task_queue.put('STOP')
|
self.task_queue.put('STOP')
|
||||||
self.task_queue.close()
|
self.task_queue.close()
|
||||||
# wait for the task queue to empty
|
# wait for the task queue to empty
|
||||||
@@ -279,7 +279,7 @@ class Sentinel(object):
|
|||||||
self.result_queue.close()
|
self.result_queue.close()
|
||||||
# Wait for the result queue to empty
|
# Wait for the result queue to empty
|
||||||
self.result_queue.join_thread()
|
self.result_queue.join_thread()
|
||||||
logger.info('{} waiting for the monitor.'.format(name))
|
logger.info(_('{} waiting for the monitor.').format(name))
|
||||||
# Wait for everything to close or time out
|
# Wait for everything to close or time out
|
||||||
count = 0
|
count = 0
|
||||||
if not self.timeout:
|
if not self.timeout:
|
||||||
@@ -510,4 +510,4 @@ def set_cpu_affinity(n, process_ids, actual=not Conf.TESTING):
|
|||||||
p = psutil.Process(pid)
|
p = psutil.Process(pid)
|
||||||
if actual:
|
if actual:
|
||||||
p.cpu_affinity(affinity)
|
p.cpu_affinity(affinity)
|
||||||
logger.info('{} will use cpu {}'.format(pid, affinity))
|
logger.info(_('{} will use cpu {}').format(pid, affinity))
|
||||||
|
|||||||
Reference in New Issue
Block a user