Merge pull request #9612 from Thunderbottom/rq-worker-name
fix(rq): randomize worker name with uuid
This commit is contained in:
commit
7f4ddbf03e
1 changed files with 3 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ import frappe
|
|||
import os, socket, time
|
||||
from frappe import _
|
||||
from six import string_types
|
||||
from uuid import uuid4
|
||||
|
||||
# imports - third-party imports
|
||||
|
||||
|
|
@ -152,7 +153,8 @@ def get_worker_name(queue):
|
|||
|
||||
if queue:
|
||||
# hostname.pid is the default worker name
|
||||
name = '{hostname}.{pid}.{queue}'.format(
|
||||
name = '{uuid}.{hostname}.{pid}.{queue}'.format(
|
||||
uuid=uuid4().hex,
|
||||
hostname=socket.gethostname(),
|
||||
pid=os.getpid(),
|
||||
queue=queue)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue