Skip to content

Commit

Permalink
better wording/flow
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Aug 30, 2023
1 parent 8185c18 commit 576565b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,14 @@ def get(self, session: so.Session, token: AccessToken.Payload):
worker = dbm.Worker.get(session, worker_name, WorkerNotFound)
if worker.user.username == token.username:
worker.last_seen = getnow()
last_ip = worker.last_ip
previous_ip = str(worker.last_ip)
worker.last_ip = worker_ip

# flush to DB so that record_ip_change has access to updated IP
session.flush()

# IP changed since last encounter
if USES_WORKERS_IPS_WHITELIST and str(last_ip) != worker_ip:
if USES_WORKERS_IPS_WHITELIST and previous_ip != worker_ip:
record_ip_change(worker_name)

request_args = WorkerRequestedTaskSchema().load(request_args)
Expand Down

0 comments on commit 576565b

Please sign in to comment.