From 23ef5759f632d29a0edadf6ede13693bcd4e8565 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sat, 25 May 2024 09:54:23 +1000 Subject: [PATCH] Removed Pholus Dependency in DBCLNP #681 --- front/plugins/db_cleanup/config.json | 5 ----- front/plugins/db_cleanup/script.py | 10 +++++----- front/plugins/pholus_scan/config.json | 2 +- server/plugin.py | 2 ++ 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/front/plugins/db_cleanup/config.json b/front/plugins/db_cleanup/config.json index 06848a57..d7ef0f44 100755 --- a/front/plugins/db_cleanup/config.json +++ b/front/plugins/db_cleanup/config.json @@ -39,11 +39,6 @@ "name" : "hourstokeepnewdevice", "type" : "setting", "value" : "HRS_TO_KEEP_NEWDEV" - }, - { - "name" : "pholuskeepdays", - "type" : "setting", - "value" : "PHOLUS_DAYS_DATA" } ], diff --git a/front/plugins/db_cleanup/script.py b/front/plugins/db_cleanup/script.py index 2e32c630..2365cf45 100755 --- a/front/plugins/db_cleanup/script.py +++ b/front/plugins/db_cleanup/script.py @@ -36,10 +36,10 @@ def main(): values = parser.parse_args() - PLUGINS_KEEP_HIST = int(values.pluginskeephistory.split('=')[1]) - HRS_TO_KEEP_NEWDEV = int(values.hourstokeepnewdevice.split('=')[1]) - DAYS_TO_KEEP_EVENTS = int(values.daystokeepevents.split('=')[1]) - PHOLUS_DAYS_DATA = int(values.pholuskeepdays.split('=')[1]) + PLUGINS_KEEP_HIST = int(values.pluginskeephistory.split('=')[1]) + HRS_TO_KEEP_NEWDEV = int(values.hourstokeepnewdevice.split('=')[1]) + DAYS_TO_KEEP_EVENTS = int(values.daystokeepevents.split('=')[1]) + PHOLUS_DAYS_DATA = get_setting_value("PHOLUS_DAYS_DATA") mylog('verbose', [f'[{pluginName}] In script']) @@ -148,7 +148,7 @@ def cleanup_database (dbPath, DAYS_TO_KEEP_EVENTS, PHOLUS_DAYS_DATA, HRS_TO_KEEP # ----------------------------------------------------- # Cleanup Pholus_Scan - if PHOLUS_DAYS_DATA != 0: + if PHOLUS_DAYS_DATA != "" and PHOLUS_DAYS_DATA != 0: mylog('verbose', [f'[{pluginName}] Pholus_Scan: Delete all older than ' + str(PHOLUS_DAYS_DATA) + ' days (PHOLUS_DAYS_DATA setting)']) # todo: improvement possibility: keep at least N per mac cursor.execute (f"""DELETE FROM Pholus_Scan diff --git a/front/plugins/pholus_scan/config.json b/front/plugins/pholus_scan/config.json index 2c726eea..914b8064 100755 --- a/front/plugins/pholus_scan/config.json +++ b/front/plugins/pholus_scan/config.json @@ -205,7 +205,7 @@ "name": [ { "language_code": "en_us", - "string": "Schedule" + "string": "Retention of data" }, { "language_code": "es_es", diff --git a/server/plugin.py b/server/plugin.py index 0f3d2d9d..d34ddce9 100755 --- a/server/plugin.py +++ b/server/plugin.py @@ -21,6 +21,8 @@ from notification import Notification_obj class plugin_param: def __init__(self, param, plugin, db): + mylog('debug', f'[Plugins] Resolving param: {param}') + paramValuesCount = 1 # Get setting value