File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -448,9 +448,8 @@ def acquire_lock(self,
448448 last_record_version_number )
449449 # if the record_version_number has not changed for more than _lease_duration period,
450450 # it basically means that the owner thread/process has died.
451- last_version_elapsed_time = time .monotonic () - last_version_fetch_time
452- if last_version_elapsed_time > existing_lock .lease_duration :
453- logger .warning ('Existing lock\' s lease has expired: %s' , str (existing_lock ))
451+ if existing_lock .expiry_time < time .time ():
452+ logger .warning ('Existing lock\' s lease has expired: %s (%s)' , str (existing_lock ), time .time ())
454453 self ._overwrite_existing_lock_in_dynamodb (new_lock , last_record_version_number )
455454 logger .debug ('Added to the DDB. Adding to in-memory map: %s' , new_lock .unique_identifier )
456455 new_lock .status = DynamoDBLock .LOCKED
You can’t perform that action at this time.
0 commit comments