Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
Import Process
Import API
Commits
49dacb33
Commit
49dacb33
authored
May 10, 2021
by
Jonas Waeber
Browse files
Try fix for class global Kafka Producer.
parent
2a3ce60d
Pipeline
#26152
passed with stages
in 2 minutes and 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
import_api_app/resources/UpdateRecordSet.py
View file @
49dacb33
...
...
@@ -11,9 +11,11 @@ from requests.auth import HTTPBasicAuth
class
UpdateRecordSet
(
Resource
):
producer
=
KafkaProducer
(
bootstrap_servers
=
current_app
.
config
[
'kafka-broker-url'
],
value_serializer
=
lambda
m
:
json
.
dumps
(
m
,
ensure_ascii
=
False
)
.
encode
(
'utf-8'
))
def
__init__
(
self
):
self
.
producer
=
KafkaProducer
(
bootstrap_servers
=
current_app
.
config
[
'kafka-broker-url'
],
value_serializer
=
lambda
m
:
json
.
dumps
(
m
,
ensure_ascii
=
False
)
.
encode
(
'utf-8'
))
# Todo write/correct comment for swagger
def
get
(
self
,
record_set_id
):
...
...
Write
Preview
Supports
Markdown
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