mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-21 22:48:16 +01:00
trying to fix dleetion of logfiles via analytics page
This commit is contained in:
parent
853920be6d
commit
90f94525be
2 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,3 @@
|
|||
__version__ = "4.1.0.rc7"
|
||||
__version__ = "4.1.0.rc8"
|
||||
__codename__ = "Groundhog Day"
|
||||
|
||||
|
|
|
@ -181,12 +181,18 @@ class LogController:
|
|||
|
||||
def clear_log(self, name:str ) -> str:
|
||||
all_filenames = glob.glob(os.path.join(self.logsFolderPath, f"sensor_{name}.log*"))
|
||||
for f in all_filenames:
|
||||
os.remove(f)
|
||||
|
||||
if name in self.datalogger:
|
||||
self.datalogger[name].removeHandler(self.datalogger[name].handlers[0])
|
||||
del self.datalogger[name]
|
||||
|
||||
for f in all_filenames:
|
||||
try:
|
||||
os.remove(f)
|
||||
except Exception as e:
|
||||
logging.warning(e)
|
||||
|
||||
|
||||
|
||||
def get_all_zip_file_names(self, name: str) -> list:
|
||||
|
||||
|
|
Loading…
Reference in a new issue