Skip to content

Commit 9352f68

Browse files
committed
improved lock value
1 parent 0378935 commit 9352f68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/service-library/src/servicelib/redis/_distributed_locks_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import asyncio
22
import datetime
33
import logging
4+
import socket
45
from collections.abc import Awaitable, Callable
56

67
import arrow
@@ -38,7 +39,7 @@ def create_exclusive_periodic_task(
3839
@exclusive(
3940
client,
4041
lock_key=f"lock:exclusive_periodic_task:{task_name}",
41-
lock_value=f"locked since {arrow.utcnow().format()} by {client.client_name}",
42+
lock_value=f"locked since {arrow.utcnow().format()} by {client.client_name} on {socket.gethostname()}",
4243
)
4344
@periodic(interval=task_period)
4445
async def _() -> None:

0 commit comments

Comments
 (0)