Merge pull request #9612 from Thunderbottom/rq-worker-name

fix(rq): randomize worker name with uuid
This commit is contained in:
mergify[bot] 2020-03-02 14:42:33 +00:00 committed by GitHub
commit 7f4ddbf03e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)