From 70797cd436be690d9c294621c92eaa84d9088f19 Mon Sep 17 00:00:00 2001 From: stephb9959 Date: Sun, 15 May 2022 10:49:40 -0700 Subject: [PATCH] Adding WifiClientHistory. --- src/StorageService.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/StorageService.cpp b/src/StorageService.cpp index f75a7b8..726cc0a 100644 --- a/src/StorageService.cpp +++ b/src/StorageService.cpp @@ -57,7 +57,12 @@ namespace OpenWifi { } done = (BoardList.size() < batch); } - Logger().information(fmt::format("Done cleanup of TimePoint Database. Next run in {} seconds.", PeriodicCleanup_)); + + auto MaxDays = MicroService::instance().ConfigGetInt("wificlient.age.limit",14); + auto LowerDate = OpenWifi::Now() - (MaxDays*60*60*24); + Logger().information(fmt::format("Removing WiFi Clients history older than {} days.", MaxDays)); + StorageService()->WifiClientHistoryDB().DeleteRecords(fmt::format(" timestamp<{} ", LowerDate)); + Logger().information(fmt::format("Done cleanup of databases. Next run in {} seconds.", PeriodicCleanup_)); } void Storage::run() {