Skip to content

Commit a5aa239

Browse files
committed
fix:updated log
1 parent 3646dd5 commit a5aa239

File tree

4 files changed

+171
-193
lines changed

4 files changed

+171
-193
lines changed

scheduler/redis_models/registry/base_registry.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ def count(self, connection: ConnectionType) -> int:
2525
return connection.zcard(self._key)
2626

2727
def add(self, connection: ConnectionType, job_name: str, score: float, update_existing_only: bool = False) -> int:
28+
logger.debug(f"[registry {self._key}] Adding {job_name} / {score}")
2829
return connection.zadd(self._key, {job_name: float(score)}, xx=update_existing_only)
2930

3031
def delete(self, connection: ConnectionType, job_name: str) -> None:
32+
logger.debug(f"[registry {self._key}] Deleting {job_name}")
3133
connection.zrem(self._key, job_name)
3234

3335

@@ -75,7 +77,7 @@ def get_first(self) -> Optional[str]:
7577
return first_job[0].decode() if first_job else None
7678

7779
def get_last_timestamp(self) -> Optional[int]:
78-
"""Returns the last timestamp in the registry."""
80+
"""Returns the latest timestamp in the registry."""
7981
self.cleanup(self.connection)
8082
last_timestamp = self.connection.zrange(self._key, -1, -1, withscores=True)
8183
return int(last_timestamp[0][1]) if last_timestamp else None

scheduler/redis_models/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def heartbeat(self, connection: ConnectionType, timeout: Optional[int] = None) -
9090
now = utcnow()
9191
self.set_field("last_heartbeat", now, connection=pipeline)
9292
pipeline.execute()
93-
logger.debug(f"Next heartbeat for worker {self._key} should arrive in {timeout} seconds.")
93+
logger.debug(f"Next heartbeat for worker {self._key} should arrive in {timeout} seconds.")
9494

9595
@classmethod
9696
def cleanup(cls, connection: ConnectionType, queue_name: Optional[str] = None):

0 commit comments

Comments
 (0)