mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-19 00:14:40 +00:00
feat: durability and idempotency keys (#2450)
* feat: durability and idempotency keys * feat: more durable frontend * fix: tests * fix: mini issues * fix: better json validation * fix: tests
This commit is contained in:
112 files changed
+13520
-614
No files matched your search
@@ -19,3 +19,24 @@ def test_make_celery(mock_celery):
|
||||
)
|
||||
celery.conf.update.assert_called_once_with(settings)
|
||||
assert celery == mock_celery.return_value
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_celeryconfig_durability_defaults():
|
||||
from application import celeryconfig
|
||||
|
||||
assert celeryconfig.task_acks_late is True
|
||||
assert celeryconfig.task_reject_on_worker_lost is True
|
||||
assert celeryconfig.worker_prefetch_multiplier == settings.CELERY_WORKER_PREFETCH_MULTIPLIER
|
||||
assert celeryconfig.worker_prefetch_multiplier == 1
|
||||
assert celeryconfig.broker_transport_options == {
|
||||
"visibility_timeout": settings.CELERY_VISIBILITY_TIMEOUT
|
||||
}
|
||||
# 1h matches Onyx/Dify defaults; long enough for ingest, short enough
|
||||
# that a SIGKILLed task redelivers within the same operator session.
|
||||
assert celeryconfig.broker_transport_options["visibility_timeout"] == 3600
|
||||
assert celeryconfig.result_expires == 86400 * 7
|
||||
assert celeryconfig.task_track_started is True
|
||||
# Project-scoped queue prevents a sibling worker on the same broker
|
||||
# from grabbing DocsGPT tasks.
|
||||
assert celeryconfig.task_default_queue == "docsgpt"
|
||||
Reference in new issue
Block a user