]> code.citadel.org Git - citadel.git/blobdiff - citadel/housekeeping.c
Started prepping for the move from LDAP Access to LDAP Sync
[citadel.git] / citadel / housekeeping.c
index b685c701af4d1f13d99bd716fd156eeb06eea183..f3577c0cf60956090fee39c2747b2e9a0a6b4ec0 100644 (file)
@@ -20,6 +20,7 @@
 #include "room_ops.h"
 #include "internet_addressing.h"
 #include "journaling.h"
+#include "citadel_ldap.h"
 
 void check_sched_shutdown(void) {
        if ((ScheduledShutdown == 1) && (ContextList == NULL)) {
@@ -98,7 +99,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 +115,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);
@@ -119,8 +126,11 @@ void do_housekeeping(void) {
 
        /* Then, do the "once per minute" stuff... */
        if (do_perminute_housekeeping_now) {
-               cdb_check_handles();                    /* suggested by Justin Case */
-               PerformSessionHooks(EVT_TIMER);         /* Run any timer hooks */
+               cdb_check_handles();
+#ifdef HAVE_LDAP
+               CtdlSynchronizeUsersFromLDAP();         // This one isn't from a module so we put it here
+#endif
+               PerformSessionHooks(EVT_TIMER);         // Run all registered TIMER hooks
        }
 
        /*