replace janky unique channel name w/ uuid

* postgres notify/listen channel names have size limitations as well as
character limitations. Respect those limitations while at the same time
generate a unique channel name.
This commit is contained in:
chris meyers 2020-03-19 08:59:15 -04:00
parent 12158bdcba
commit 7f2e1d46bc

View File

@ -1,5 +1,5 @@
import logging
import string
import uuid
import random
import json
@ -29,8 +29,7 @@ class Control(object):
@classmethod
def generate_reply_queue_name(cls):
letters = string.ascii_lowercase
return 'reply_to_{}'.format(''.join(random.choice(letters) for i in range(8)))
return f"reply_to_{str(uuid.uuid4()).replace('-','_')}"
def control_with_reply(self, command, timeout=5):
logger.warn('checking {} {} for {}'.format(self.service, command, self.queuename))