From adcd76b706d358e5c13bd582e2d20b554092b916 Mon Sep 17 00:00:00 2001 From: Hans Aarne Liblik Date: Thu, 15 Jun 2023 15:30:48 +0300 Subject: [PATCH 1/2] Add type for worker.request.Request.on_timeout --- celery-stubs/worker/request.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/celery-stubs/worker/request.pyi b/celery-stubs/worker/request.pyi index 65ce43d..ca52199 100644 --- a/celery-stubs/worker/request.pyi +++ b/celery-stubs/worker/request.pyi @@ -127,6 +127,7 @@ class Request: def revoked(self) -> bool: ... def send_event(self, type: str, **fields: Any) -> None: ... def on_accepted(self, pid: str, time_accepted: float) -> None: ... + def on_timeout(self, soft: bool, timeout: int) -> None: ... def on_success( self, failed__retval__runtime: tuple[Any, Any, Any], **kwargs: Any ) -> None: ... From 70a287af6cdaa8bb8555df68a2bba9edc2a185cc Mon Sep 17 00:00:00 2001 From: Hans Aarne Liblik Date: Fri, 16 Jun 2023 07:40:23 +0300 Subject: [PATCH 2/2] Update celery-stubs/worker/request.pyi Co-authored-by: Marti Raudsepp --- celery-stubs/worker/request.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/celery-stubs/worker/request.pyi b/celery-stubs/worker/request.pyi index ca52199..eaadf7c 100644 --- a/celery-stubs/worker/request.pyi +++ b/celery-stubs/worker/request.pyi @@ -127,7 +127,7 @@ class Request: def revoked(self) -> bool: ... def send_event(self, type: str, **fields: Any) -> None: ... def on_accepted(self, pid: str, time_accepted: float) -> None: ... - def on_timeout(self, soft: bool, timeout: int) -> None: ... + def on_timeout(self, soft: bool, timeout: int | float) -> None: ... def on_success( self, failed__retval__runtime: tuple[Any, Any, Any], **kwargs: Any ) -> None: ...