]> code.citadel.org Git - citadel.git/blobdiff - citadel/housekeeping.c
Log a warning message if housekeeping has not run in more than 5 minutes
[citadel.git] / citadel / housekeeping.c
index 139ada05ee63915e6716285c2f2d7791e8df2e69..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);
@@ -164,7 +170,7 @@ retry_wait_for_contexts:
        {
                for (i=0; i<nContexts; i++) 
                {
-                       if ((nptr[i].state != CON_SYS) || (nptr[i].IO == NULL) || (nptr[i].lastcmd == 0))
+                       if ((nptr[i].state != CON_SYS) || (nptr[i].lastcmd == 0))
                                continue;
                        ActiveBackgroundJobs ++;
                        syslog(LOG_INFO, "jousekeeping: job CC[%d] active; use TERM if you don't want to wait for it", nptr[i].cs_pid);