Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
2c7dddbb
Commit
2c7dddbb
authored
Apr 20, 2018
by
Samuel GAIST
Browse files
[worker] Update all send_multipart call and remove str
In Python 3, network is using bytes.
parent
ae955119
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/core/worker.py
View file @
2c7dddbb
...
...
@@ -87,7 +87,7 @@ class WorkerController(object):
def
destroy
(
self
):
for
worker
in
self
.
workers
:
self
.
socket
.
send_multipart
([
str
(
worker
)
,
worker
,
WorkerController
.
SCHEDULER_SHUTDOWN
,
])
...
...
@@ -106,24 +106,24 @@ class WorkerController(object):
def
execute
(
self
,
worker
,
job_id
,
configuration
):
self
.
socket
.
send_multipart
([
str
(
worker
)
,
worker
,
WorkerController
.
EXECUTE
,
str
(
job_id
),
simplejson
.
dumps
(
configuration
)
b
'{}'
.
format
(
job_id
),
simplejson
.
dumps
(
configuration
)
.
encode
(
'utf-8'
)
])
def
cancel
(
self
,
worker
,
job_id
):
self
.
socket
.
send_multipart
([
str
(
worker
)
,
worker
,
WorkerController
.
CANCEL
,
str
(
job_id
)
b
'{}'
.
format
(
job_id
)
,
])
def
ack
(
self
,
worker
):
self
.
socket
.
send_multipart
([
str
(
worker
)
,
worker
,
WorkerController
.
ACK
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment