nucliadb 6.3.1.post3577__py3-none-any.whl → 6.3.1.post3584__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nucliadb/tasks/retries.py +6 -5
- {nucliadb-6.3.1.post3577.dist-info → nucliadb-6.3.1.post3584.dist-info}/METADATA +6 -6
- {nucliadb-6.3.1.post3577.dist-info → nucliadb-6.3.1.post3584.dist-info}/RECORD +6 -6
- {nucliadb-6.3.1.post3577.dist-info → nucliadb-6.3.1.post3584.dist-info}/WHEEL +0 -0
- {nucliadb-6.3.1.post3577.dist-info → nucliadb-6.3.1.post3584.dist-info}/entry_points.txt +0 -0
- {nucliadb-6.3.1.post3577.dist-info → nucliadb-6.3.1.post3584.dist-info}/top_level.txt +0 -0
nucliadb/tasks/retries.py
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
import functools
|
21
21
|
import logging
|
22
22
|
from enum import Enum
|
23
|
-
from typing import Optional
|
23
|
+
from typing import Callable, Optional
|
24
24
|
|
25
25
|
from pydantic import BaseModel
|
26
26
|
|
@@ -73,7 +73,8 @@ class TaskRetryHandler:
|
|
73
73
|
self.kbid = kbid
|
74
74
|
self.task_type = task_type
|
75
75
|
self.task_id = task_id
|
76
|
-
|
76
|
+
# Limit max retries to 50
|
77
|
+
self.max_retries = min(max_retries, 50)
|
77
78
|
self.context = context
|
78
79
|
|
79
80
|
@property
|
@@ -94,7 +95,7 @@ class TaskRetryHandler:
|
|
94
95
|
await txn.set(self.metadata_key, metadata.model_dump_json().encode())
|
95
96
|
await txn.commit()
|
96
97
|
|
97
|
-
def wrap(self, func):
|
98
|
+
def wrap(self, func: Callable) -> Callable:
|
98
99
|
@functools.wraps(func)
|
99
100
|
async def wrapper(*args, **kwargs):
|
100
101
|
func_result = None
|
@@ -110,7 +111,7 @@ class TaskRetryHandler:
|
|
110
111
|
|
111
112
|
if metadata.status in (TaskMetadata.Status.COMPLETED, TaskMetadata.Status.FAILED):
|
112
113
|
logger.info(
|
113
|
-
f"{self.
|
114
|
+
f"{self.task_type} task is {metadata.status.value}. Skipping",
|
114
115
|
extra={"kbid": self.kbid, "task_type": self.task_type, "task_id": self.task_id},
|
115
116
|
)
|
116
117
|
return
|
@@ -130,7 +131,7 @@ class TaskRetryHandler:
|
|
130
131
|
except Exception as ex:
|
131
132
|
metadata.retries += 1
|
132
133
|
metadata.error_messages.append(str(ex))
|
133
|
-
logger.
|
134
|
+
logger.exception(
|
134
135
|
f"Task failed. Will be retried",
|
135
136
|
extra={"kbid": self.kbid, "task_type": self.task_type, "task_id": self.task_id},
|
136
137
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: nucliadb
|
3
|
-
Version: 6.3.1.
|
3
|
+
Version: 6.3.1.post3584
|
4
4
|
Summary: NucliaDB
|
5
5
|
Author-email: Nuclia <nucliadb@nuclia.com>
|
6
6
|
License: AGPL
|
@@ -20,11 +20,11 @@ Classifier: Programming Language :: Python :: 3.12
|
|
20
20
|
Classifier: Programming Language :: Python :: 3 :: Only
|
21
21
|
Requires-Python: <4,>=3.9
|
22
22
|
Description-Content-Type: text/markdown
|
23
|
-
Requires-Dist: nucliadb-telemetry[all]>=6.3.1.
|
24
|
-
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.1.
|
25
|
-
Requires-Dist: nucliadb-protos>=6.3.1.
|
26
|
-
Requires-Dist: nucliadb-models>=6.3.1.
|
27
|
-
Requires-Dist: nidx-protos>=6.3.1.
|
23
|
+
Requires-Dist: nucliadb-telemetry[all]>=6.3.1.post3584
|
24
|
+
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.1.post3584
|
25
|
+
Requires-Dist: nucliadb-protos>=6.3.1.post3584
|
26
|
+
Requires-Dist: nucliadb-models>=6.3.1.post3584
|
27
|
+
Requires-Dist: nidx-protos>=6.3.1.post3584
|
28
28
|
Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
|
29
29
|
Requires-Dist: nuclia-models>=0.24.2
|
30
30
|
Requires-Dist: uvicorn
|
@@ -272,7 +272,7 @@ nucliadb/tasks/consumer.py,sha256=xc0Ql3N1Iq52dJ3t4YYGJFj1NCQAly0J5W_brfLa_F8,68
|
|
272
272
|
nucliadb/tasks/logger.py,sha256=C7keOEO_mjLVp5VbqAZ2QXfqVB2Hot7NgBlUP_SDSMw,924
|
273
273
|
nucliadb/tasks/models.py,sha256=qrZKi5DNDQ07waMsp5L4_Fi7WRs57YiO-kmXlrBzEAA,1168
|
274
274
|
nucliadb/tasks/producer.py,sha256=UnpJAzhj_GElsCoO5G6T4m6MshsgOaqR2tVzJmEta64,2625
|
275
|
-
nucliadb/tasks/retries.py,sha256=
|
275
|
+
nucliadb/tasks/retries.py,sha256=tLNtwAutGEfFV3Adr4a9ew-Wg4vuxBd72GGDE_Mma8s,5160
|
276
276
|
nucliadb/tasks/utils.py,sha256=tV1AbWdFc3qfIULX44Veqj41FCD1B6XYjG6brULBeiw,1459
|
277
277
|
nucliadb/tests/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
278
278
|
nucliadb/tests/config.py,sha256=JN_Jhgj-fwM9_8IeO9pwxr6C1PiwRDrXxm67Y38rU30,2080
|
@@ -347,8 +347,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
|
|
347
347
|
nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
|
348
348
|
nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
|
349
349
|
nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
|
350
|
-
nucliadb-6.3.1.
|
351
|
-
nucliadb-6.3.1.
|
352
|
-
nucliadb-6.3.1.
|
353
|
-
nucliadb-6.3.1.
|
354
|
-
nucliadb-6.3.1.
|
350
|
+
nucliadb-6.3.1.post3584.dist-info/METADATA,sha256=1LFsE32EtmIRlKK9EAN1-kK6P5pfLq3pIRewpO0k2Ug,4291
|
351
|
+
nucliadb-6.3.1.post3584.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
352
|
+
nucliadb-6.3.1.post3584.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
|
353
|
+
nucliadb-6.3.1.post3584.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
|
354
|
+
nucliadb-6.3.1.post3584.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|