Fix as_text in certain conditions (#1917)

main
Cyril Chapellier 2 years ago committed by GitHub
parent 192fbc9c50
commit 0b5a90adac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1040,12 +1040,11 @@ class Worker(BaseWorker):
version, version,
python_version, python_version,
) = data ) = data
queues = as_text(queues) self.hostname = as_text(hostname) if hostname else None
self.hostname = as_text(hostname) self.ip_address = as_text(ip_address) if ip_address else None
self.ip_address = as_text(ip_address)
self.pid = int(pid) if pid else None self.pid = int(pid) if pid else None
self.version = as_text(version) self.version = as_text(version) if version else None
self.python_version = as_text(python_version) self.python_version = as_text(python_version) if python_version else None
self._state = as_text(state or '?') self._state = as_text(state or '?')
self._job_id = job_id or None self._job_id = job_id or None
if last_heartbeat: if last_heartbeat:
@ -1066,6 +1065,7 @@ class Worker(BaseWorker):
self.current_job_working_time = float(as_text(current_job_working_time)) self.current_job_working_time = float(as_text(current_job_working_time))
if queues: if queues:
queues = as_text(queues)
self.queues = [ self.queues = [
self.queue_class( self.queue_class(
queue, connection=self.connection, job_class=self.job_class, serializer=self.serializer queue, connection=self.connection, job_class=self.job_class, serializer=self.serializer

Loading…
Cancel
Save