Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FS-SC
AsapoWorker
Commits
03ffe9d2
Commit
03ffe9d2
authored
May 18, 2021
by
Mikhail Karnevskiy
Browse files
modify group_if in options of receiver based on sender data_source
parent
cc46d3e4
Pipeline
#6472
passed with stage
in 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/AsapoWorker/application.py
View file @
03ffe9d2
...
...
@@ -104,6 +104,11 @@ class Application:
if
key
not
in
self
.
options
:
self
.
options
[
key
]
=
{}
if
"data_source"
in
self
.
options
[
"sender"
]
and
"group_id"
not
in
self
.
options
[
"receiver"
]:
sender_data_source
=
self
.
options
[
"sender"
][
"data_source"
]
group_id
=
str
(
binascii
.
crc32
(
sender_data_source
.
encode
()))
self
.
options
[
"receiver"
][
"group_id"
]
=
group_id
def
_setup_logging
(
self
):
log_level
=
self
.
options
[
"log_level"
]
format
=
(
...
...
@@ -161,12 +166,6 @@ class Application:
if
sender
:
sender
.
stream
=
stream
if
sender
and
"group_id"
not
in
self
.
options
[
"receiver"
]:
sender_data_source
=
self
.
options
[
"sender"
][
"data_source"
]
group_id
=
str
(
binascii
.
crc32
(
sender_data_source
.
encode
()))
consumer
.
group_id
=
group_id
log
.
info
(
f
"Set consumer group ID=%s, group_id"
)
worker
=
create_instance_from_configurable
(
self
.
worker_class
,
self
.
options
[
"worker"
])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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