diff options
| author | 2019-11-25 18:18:09 +0000 | |
|---|---|---|
| committer | 2019-11-25 18:18:09 +0000 | |
| commit | 93aea08818252dd65a02a31894bfeea9fc0e45b9 (patch) | |
| tree | 2de12f1bb644bd37c90c8f7d151b7a5b715ff7aa /src/LockFile.py | |
| parent | add `cookies` and `.json()` to utils.http.Response objects (diff) | |
| signature | ||
utils.datetime.datetime_utcnow() -> utils.datetime.utcnow()
Diffstat (limited to 'src/LockFile.py')
| -rw-r--r-- | src/LockFile.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/LockFile.py b/src/LockFile.py index 309e8e87..54ff6284 100644 --- a/src/LockFile.py +++ b/src/LockFile.py @@ -9,7 +9,7 @@ class LockFile(PollHook.PollHook): self._next_lock = None def available(self): - now = utils.datetime.datetime_utcnow() + now = utils.datetime.utcnow() if os.path.exists(self._filename): with open(self._filename, "r") as lock_file: timestamp_str = lock_file.read().strip().split(" ", 1)[0] @@ -23,14 +23,14 @@ class LockFile(PollHook.PollHook): def lock(self): with open(self._filename, "w") as lock_file: - last_lock = utils.datetime.datetime_utcnow() + last_lock = utils.datetime.utcnow() lock_file.write("%s" % utils.datetime.iso8601_format(last_lock)) self._next_lock = last_lock+datetime.timedelta( seconds=EXPIRATION/2) def next(self): return max(0, - (self._next_lock-utils.datetime.datetime_utcnow()).total_seconds()) + (self._next_lock-utils.datetime.utcnow()).total_seconds()) def call(self): self.lock() |
