summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp1
-rw-r--r--src/timer.cpp21
2 files changed, 22 insertions, 0 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 72a02d3bc..ee30ba4e9 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -641,6 +641,7 @@ int InspIRCd::Run()
{
expire_lines();
FOREACH_MOD(I_OnBackgroundTimer,OnBackgroundTimer(TIME));
+ TickMissedTimers(TIME);
expire_run = true;
continue;
}
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;