Skip to content

Commit

Permalink
feat: avoid excessive check_in commits
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 committed May 30, 2024
1 parent c671a7e commit 3dc1457
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions horde/classes/base/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ def toggle_paused(self, is_paused_active):

# This should be extended by each worker type
def check_in(self, **kwargs):
# To avoid excessive commits,
# we only record new changes on the worker every 30 seconds
if (datetime.utcnow() - self.last_check_in).total_seconds() < 30:
return
self.ipaddr = kwargs.get("ipaddr", None)
self.bridge_agent = sanitize_string(kwargs.get("bridge_agent", "unknown:0:unknown"))
self.threads = kwargs.get("threads", 1)
Expand Down

0 comments on commit 3dc1457

Please sign in to comment.