From 991bc1d3cf461e828b58864888593e6f09a3ac0c Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 23 Feb 2006 20:35:52 +0000 Subject: Look-behind for missed timers up to 2 minutes (if your ircd has hung for 2 minutes, or your clock drift is > 2 mins, you have bigger fish to fry, like dead network or TS split) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3310 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/timer.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/timer.cpp') diff --git a/src/timer.cpp b/src/timer.cpp index b804920e5..7d9c9f3df 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -65,6 +65,27 @@ void TickTimers(time_t TIME) } } +void TickMissedTimers(time_t TIME) +{ + for (time_t n = TIME-1; time_t n > TIME-120; n--) + { + timerlist::iterator found = Timers.find(n); + if (found != Timers.end()) + { + timergroup* x = found->second; + for (timergroup::iterator y = x->begin(); y != x->end(); y++) + { + InspTimer* z = (InspTimer*)*y; + z->Tick(TIME); + delete z; + } + + Timers.erase(found); + delete x; + } + } +} + void AddTimer(InspTimer* T) { timergroup* x = NULL; -- cgit v1.2.3