mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-09 17:07:43 +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"
|
__codename__ = "Groundhog Day"
|
||||||
|
|
||||||
|
|
|
@ -181,12 +181,18 @@ class LogController:
|
||||||
|
|
||||||
def clear_log(self, name:str ) -> str:
|
def clear_log(self, name:str ) -> str:
|
||||||
all_filenames = glob.glob(os.path.join(self.logsFolderPath, f"sensor_{name}.log*"))
|
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:
|
if name in self.datalogger:
|
||||||
|
self.datalogger[name].removeHandler(self.datalogger[name].handlers[0])
|
||||||
del self.datalogger[name]
|
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:
|
def get_all_zip_file_names(self, name: str) -> list:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue