This one fixes a bug in the notify system. It makes it possible to
alter NOTIFY_INTERVAL without the consequence of having to wait for the
previously set interval to time out. This can be used to switch notify
queries off in the case of lag say.
diff -ruN ../epic4-1.0.1/source/notify.c ./source/notify.c
--- ../epic4-1.0.1/source/notify.c      Tue Dec  5 11:11:57 2000
+++ ./source/notify.c   Sat Sep  8 18:55:55 2001
@@ -296,7 +296,7 @@
 {
        int             old_from_server = from_server;
        int             servnum;
-static time_t          next_notify = 0;
+static time_t          last_notify = 0;
        int             interval = get_int_var(NOTIFY_INTERVAL_VAR);
 
        if (!number_of_servers)
@@ -305,19 +305,18 @@
        if (x_debug & DEBUG_NOTIFY)
                yell("do_notify() was called...");
 
-       if (!next_notify)
-               next_notify = time(NULL);
-       else if (time(NULL) < next_notify)
+       if (!last_notify)
+               last_notify = time(NULL);
+       else if (interval > (time(NULL) - last_notify))
        {
                if (x_debug & DEBUG_NOTIFY)
                        yell("Not time for notify yet [%ld] [%ld]",
-                               time(NULL), next_notify);
+                               time(NULL), last_notify+interval);
 
                return;         /* Not yet */
        }
 
-       /* We want to do it *on average* every 'interval' seconds */
-       next_notify += interval;
+       last_notify = time(NULL);
        for (servnum = 0; servnum < number_of_servers; servnum++)
        {
                if (is_server_connected(servnum))

Reply via email to