Skip to content

Commit 8160618

Browse files
authored
Bump Karton to v5.1.0 (#829)
1 parent a08e577 commit 8160618

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

mwdb/core/karton.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,26 @@
33
from flask import g
44
from karton.core import Config as KartonConfig
55
from karton.core import Producer, Resource, Task
6-
from karton.core.backend import KartonBackend
76
from karton.core.inspect import KartonState
87
from karton.core.task import TaskPriority
98

9+
from ..version import app_version
1010
from .config import app_config
1111

1212
logger = logging.getLogger("mwdb.karton")
1313

1414

15+
class KartonProducer(Producer):
16+
identity = "karton.mwdb"
17+
version = app_version
18+
with_service_info = True
19+
20+
21+
karton_producer = KartonProducer(config=KartonConfig(app_config.karton.config_path))
22+
23+
1524
def get_karton_producer() -> Producer:
16-
return Producer(
17-
identity="karton.mwdb", config=KartonConfig(app_config.karton.config_path)
18-
)
25+
return karton_producer
1926

2027

2128
def send_file_to_karton(file) -> str:
@@ -91,7 +98,5 @@ def send_blob_to_karton(blob) -> str:
9198

9299

93100
def get_karton_state():
94-
karton_config = KartonConfig(app_config.karton.config_path)
95-
karton_backend = KartonBackend(karton_config)
96-
karton_state = KartonState(karton_backend)
101+
karton_state = KartonState(karton_producer.backend)
97102
return karton_state

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PyYAML==5.4
2121
redis==4.5.4
2222
boto3==1.24.38
2323
typed-config==1.1.0
24-
karton-core==5.0.0
24+
karton-core==5.1.0
2525
Authlib==0.15.4
2626
prance==0.21.8.0 # apispec unpinned dependency
2727
pyJWT==2.4.0

0 commit comments

Comments
 (0)