From 46016d1d9bb052f370ff1784b654867b06e72f2e Mon Sep 17 00:00:00 2001 From: Heiko Nickerl Date: Sat, 29 Aug 2026 09:55:57 +0200 Subject: [PATCH] fix: allow disabling journal and idempotency retention Setting retention times to `timedelta(seconds=0)` was silently dropped; instead, the global defaults were used. Now, settings the retention times to 0s properly disables the rentention. --- python/restate/discovery.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/python/restate/discovery.py b/python/restate/discovery.py index b6a0d95..4fc45ea 100644 --- a/python/restate/discovery.py +++ b/python/restate/discovery.py @@ -346,14 +346,16 @@ def compute_discovery(endpoint: RestateEndpoint, discovered_as: typing.Literal[" description=handler.description, metadata=handler.metadata, inactivityTimeout=int(handler.inactivity_timeout.total_seconds() * 1000) - if handler.inactivity_timeout + if handler.inactivity_timeout is not None + else None, + abortTimeout=int(handler.abort_timeout.total_seconds() * 1000) + if handler.abort_timeout is not None else None, - abortTimeout=int(handler.abort_timeout.total_seconds() * 1000) if handler.abort_timeout else None, journalRetention=int(handler.journal_retention.total_seconds() * 1000) - if handler.journal_retention + if handler.journal_retention is not None else None, idempotencyRetention=int(handler.idempotency_retention.total_seconds() * 1000) - if handler.idempotency_retention + if handler.idempotency_retention is not None else None, workflowCompletionRetention=int(handler.workflow_retention.total_seconds() * 1000) if handler.workflow_retention @@ -394,14 +396,16 @@ def compute_discovery(endpoint: RestateEndpoint, discovered_as: typing.Literal[" description=description, metadata=metadata, inactivityTimeout=int(service.inactivity_timeout.total_seconds() * 1000) - if service.inactivity_timeout + if service.inactivity_timeout is not None + else None, + abortTimeout=int(service.abort_timeout.total_seconds() * 1000) + if service.abort_timeout is not None else None, - abortTimeout=int(service.abort_timeout.total_seconds() * 1000) if service.abort_timeout else None, journalRetention=int(service.journal_retention.total_seconds() * 1000) - if service.journal_retention + if service.journal_retention is not None else None, idempotencyRetention=int(service.idempotency_retention.total_seconds() * 1000) - if service.idempotency_retention + if service.idempotency_retention is not None else None, enableLazyState=service.enable_lazy_state if isinstance(service, (Workflow, VirtualObject)) else None, ingressPrivate=service.ingress_private,