Skip to content

Commit 40a0767

Browse files
author
Andrei Neagu
committed
fixed removal
1 parent 0c8ed8a commit 40a0767

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

packages/service-library/src/servicelib/long_running_tasks/_rpc_client.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,13 @@ async def remove_task(
118118
*,
119119
task_context: TaskContext,
120120
task_id: TaskId,
121-
cancellation_timeout: timedelta | None,
122121
) -> None:
123-
timeout_s = (
124-
None
125-
if cancellation_timeout is None
126-
else int(cancellation_timeout.total_seconds())
127-
)
128122

129123
result = await rabbitmq_rpc_client.request(
130124
get_rabbit_namespace(namespace),
131125
TypeAdapter(RPCMethodName).validate_python("remove_task"),
132126
task_context=task_context,
133127
task_id=task_id,
134-
timeout_s=timeout_s,
128+
timeout_s=_RPC_TIMEOUT_SHORT_REQUESTS,
135129
)
136130
assert result is None # nosec

packages/service-library/src/servicelib/long_running_tasks/lrt_api.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from datetime import timedelta
21
from typing import Any
32

43
from ..rabbitmq._client_rpc import RabbitMQRPCClient
@@ -103,8 +102,6 @@ async def remove_task(
103102
lrt_namespace: LRTNamespace,
104103
task_context: TaskContext,
105104
task_id: TaskId,
106-
*,
107-
cancellation_timeout: timedelta | None = None,
108105
) -> None:
109106
"""cancels and removes a task
110107
@@ -115,5 +112,4 @@ async def remove_task(
115112
lrt_namespace,
116113
task_id=task_id,
117114
task_context=task_context,
118-
cancellation_timeout=cancellation_timeout,
119115
)

0 commit comments

Comments
 (0)