From 7b92376d3c819cfe849b92dfc5c312084408af9c Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 12 Jul 2017 12:31:42 -0400 Subject: [PATCH] Log a warning message if housekeeping has not run in more than 5 minutes --- citadel/housekeeping.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/citadel/housekeeping.c b/citadel/housekeeping.c index b685c701a..dae17c3ea 100644 --- a/citadel/housekeeping.c +++ b/citadel/housekeeping.c @@ -98,7 +98,14 @@ void do_housekeeping(void) { } end_critical_section(S_HOUSEKEEPING); + now = time(NULL); if (do_housekeeping_now == 0) { + if ( (now - last_timer) > (time_t)300 ) { + syslog(LOG_WARNING, + "housekeeping: WARNING: housekeeping loop has not run for %ld minutes. Is something stuck?", + ((now - last_timer) / 60) + ); + } return; } @@ -107,7 +114,6 @@ void do_housekeeping(void) { * loop. Everything below this point is real work. */ - now = time(NULL); if ( (now - last_timer) > (time_t)60 ) { do_perminute_housekeeping_now = 1; last_timer = time(NULL); -- 2.30.2