Log a warning message if housekeeping has not run in more than 5 minutes
authorArt Cancro <ajc@citadel.org>
Wed, 12 Jul 2017 16:31:42 +0000 (12:31 -0400)
committerArt Cancro <ajc@citadel.org>
Wed, 12 Jul 2017 16:31:42 +0000 (12:31 -0400)
citadel/housekeeping.c

index b685c701af4d1f13d99bd716fd156eeb06eea183..dae17c3eab220770de5ad614244704063adb3f7d 100644 (file)
@@ -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);