Skip to content

Commit

Permalink
Changed back to getmtime
Browse files Browse the repository at this point in the history
  • Loading branch information
rohe committed Feb 27, 2024
1 parent 1f0ffbe commit ff2daae
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/idpyoidc/storage/listfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
import os
from pathlib import Path
import time

from filelock import FileLock
Expand Down Expand Up @@ -40,14 +39,13 @@ def get_mtime(fname):
:param fname: File name
:return: The last time the file was modified.
"""
p = Path(fname)
try:
mtime = p.stat().st_mtime
mtime = os.path.getmtime(fname)
except OSError:
# The file might be right in the middle of being created
# so sleep
time.sleep(1)
mtime = p.stat().st_mtime
mtime = os.path.getmtime(fname)

return mtime

Expand All @@ -65,7 +63,7 @@ def is_changed(self, fname):
self.fmtime = mtime
return True

if mtime > self.fmtime: # has changed
if mtime != self.fmtime: # has changed
self.fmtime = mtime
return True
else:
Expand Down

0 comments on commit ff2daae

Please sign in to comment.