fix(token_manager): race condition for file stat
Python Lint CI / ruff-format-check (push) Successful in 9m32s
Python Lint CI / ruff (push) Successful in 9m33s
Python Lint CI / ty (push) Successful in 9m18s
Docker CI / docker-build (push) Successful in 10m35s
Python Test CI / coverage (push) Successful in 2m20s
Python Lint CI / ruff-format-check (push) Successful in 9m32s
Python Lint CI / ruff (push) Successful in 9m33s
Python Lint CI / ty (push) Successful in 9m18s
Docker CI / docker-build (push) Successful in 10m35s
Python Test CI / coverage (push) Successful in 2m20s
This commit is contained in:
@@ -67,10 +67,11 @@ class TokenManager:
|
|||||||
def detect_file_change(self) -> bool:
|
def detect_file_change(self) -> bool:
|
||||||
if (
|
if (
|
||||||
self.tokens_file.exists()
|
self.tokens_file.exists()
|
||||||
and self.tokens_file.stat().st_mtime != self.last_file_change
|
and (file_change := self.tokens_file.stat().st_mtime)
|
||||||
|
!= self.last_file_change
|
||||||
):
|
):
|
||||||
self.logger.debug("Detected change: %s", self.tokens_file)
|
self.logger.debug("Detected change: %s", self.tokens_file)
|
||||||
self.last_file_change = self.tokens_file.stat().st_mtime
|
self.last_file_change = file_change
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user