From b0f2ff6302f0d781d7f59ceaafaa607328f0b807 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 8 Dec 2020 10:21:55 -0500 Subject: [PATCH] Add Session cleaning --- scripts/zmstats.pl.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/zmstats.pl.in b/scripts/zmstats.pl.in index 8aef4ddc6..81fdd3129 100644 --- a/scripts/zmstats.pl.in +++ b/scripts/zmstats.pl.in @@ -91,6 +91,9 @@ while( 1 ) { } } # end if ZM_LOG_DATABASE_LIMIT + # Delete any sessions that are more ethan a week old. Limiting to 100 because mysql sucks + zmDbDo('DELETE FROM Sessions WHERE access < ? LIMIT 100', time - (60*60*24*7)); + sleep($Config{ZM_STATS_UPDATE_INTERVAL}); } # end while (1)