os.remove(file_lock)
except Exception as e:
if os.path.exists(file_lock):
os.remove(file_lock)
raise e
def _log_working_time(self, mturk_worker):
additional_time = time.time() - mturk_worker.creation_time
After Change
file_path = os.path.join(parent_dir, TIME_LOGS_FILE_NAME)
file_lock = os.path.join(parent_dir, TIME_LOGS_FILE_LOCK)
with LockFile(file_lock) as _lock_file:
assert _lock_file is not None
if os.path.exists(file_path):
if not force:
with open(file_path, "rb+") as time_log_file:
existing_times = pickle.load(time_log_file)