File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 3
3
from flask import g
4
4
from karton .core import Config as KartonConfig
5
5
from karton .core import Producer , Resource , Task
6
- from karton .core .backend import KartonBackend
7
6
from karton .core .inspect import KartonState
8
7
from karton .core .task import TaskPriority
9
8
9
+ from ..version import app_version
10
10
from .config import app_config
11
11
12
12
logger = logging .getLogger ("mwdb.karton" )
13
13
14
14
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
+
15
24
def get_karton_producer () -> Producer :
16
- return Producer (
17
- identity = "karton.mwdb" , config = KartonConfig (app_config .karton .config_path )
18
- )
25
+ return karton_producer
19
26
20
27
21
28
def send_file_to_karton (file ) -> str :
@@ -91,7 +98,5 @@ def send_blob_to_karton(blob) -> str:
91
98
92
99
93
100
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 )
97
102
return karton_state
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ PyYAML==5.4
21
21
redis == 4.5.4
22
22
boto3 == 1.24.38
23
23
typed-config == 1.1.0
24
- karton-core == 5.0 .0
24
+ karton-core == 5.1 .0
25
25
Authlib == 0.15.4
26
26
prance == 0.21.8.0 # apispec unpinned dependency
27
27
pyJWT == 2.4.0
You can’t perform that action at this time.
0 commit comments