mirror of https://gitlab.com/bashrc2/epicyon
Only return true if broch mode lapses
parent
a9d1927eb1
commit
dd8b9da31c
|
@ -706,9 +706,9 @@ def brochModeLapses(baseDir: str, lapseDays=7) -> bool:
|
||||||
modifiedDate = \
|
modifiedDate = \
|
||||||
datetime.strptime(lastModified, "%Y-%m-%dT%H:%M:%SZ")
|
datetime.strptime(lastModified, "%Y-%m-%dT%H:%M:%SZ")
|
||||||
except BaseException:
|
except BaseException:
|
||||||
return brochMode
|
return False
|
||||||
if not modifiedDate:
|
if not modifiedDate:
|
||||||
return brochMode
|
return False
|
||||||
currTime = datetime.datetime.utcnow()
|
currTime = datetime.datetime.utcnow()
|
||||||
daysSinceBroch = (currTime - modifiedDate).days
|
daysSinceBroch = (currTime - modifiedDate).days
|
||||||
if daysSinceBroch >= lapseDays:
|
if daysSinceBroch >= lapseDays:
|
||||||
|
@ -717,6 +717,7 @@ def brochModeLapses(baseDir: str, lapseDays=7) -> bool:
|
||||||
brochMode = False
|
brochMode = False
|
||||||
setConfigParam(baseDir, "brochMode", brochMode)
|
setConfigParam(baseDir, "brochMode", brochMode)
|
||||||
print('Broch mode has elapsed')
|
print('Broch mode has elapsed')
|
||||||
|
return True
|
||||||
except BaseException:
|
except BaseException:
|
||||||
pass
|
pass
|
||||||
return brochMode
|
return False
|
||||||
|
|
Loading…
Reference in New Issue