1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 17:04:47 +02:00

Change Timer::Tick to return bool, get rid of the repeating field.

This commit is contained in:
Sadie Powell
2026-05-02 14:34:17 +01:00
parent c0bafe10b4
commit f12b590a6d
15 changed files with 52 additions and 53 deletions
+2 -1
View File
@@ -194,12 +194,13 @@ namespace DNS
/** Used to time out the query, xalls OnError and lets the TimerManager
* delete this request.
*/
void Tick() override
bool Tick() override
{
Log(LOG_DEBUG_2) << "Resolver: timeout for query " << this->name;
Query rr(*this);
rr.error = ERROR_TIMEDOUT;
this->OnError(&rr);
return false;
}
};
+3 -14
View File
@@ -31,23 +31,17 @@ private:
*/
time_t secs;
/** True if this is a repeating timer
*/
bool repeat;
public:
/** Constructor, initializes the triggering time
* @param time_from_now The number of seconds from now to trigger the timer
* @param repeating Repeat this timer every time_from_now if this is true
*/
Timer(time_t time_from_now, bool repeating = false);
Timer(time_t time_from_now);
/** Constructor, initializes the triggering time
* @param creator The creator of the timer
* @param time_from_now The number of seconds from now to trigger the timer
* @param repeating Repeat this timer every time_from_now if this is true
*/
Timer(Module *creator, time_t time_from_now, bool repeating = false);
Timer(Module *creator, time_t time_from_now);
/** Destructor, removes the timer from the list
*/
@@ -63,11 +57,6 @@ public:
*/
time_t GetTimer() const;
/** Returns true if the timer is set to repeat
* @return Returns true if the timer is set to repeat
*/
bool GetRepeat() const;
/** Set the interval between ticks
* @paramt t The new interval
*/
@@ -86,7 +75,7 @@ public:
/** Called when the timer ticks
* This should be overridden with something useful
*/
virtual void Tick() = 0;
virtual bool Tick() = 0;
};
/** This class manages sets of Timers, and triggers them at their defined times.