MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / rearm

Method rearm

src/core/NetScheduler.cpp:37–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37void NetScheduler::rearm()
38{
39 m_timer.stop();
40 const QDateTime now = nowUtc();
41
42 // Prune fired keys for occurrences now safely in the past.
43 for (auto it = m_firedKeys.begin(); it != m_firedKeys.end();) {
44 const qint64 occMs = it->section('|', 1).toLongLong();
45 if (occMs < now.toMSecsSinceEpoch() - 60000)
46 it = m_firedKeys.erase(it);
47 else
48 ++it;
49 }
50
51 m_armed = nextReminderAcross(m_entries, now);
52 if (!m_armed.isValid())
53 return;
54
55 const qint64 ms = now.msecsTo(m_armed.reminderUtc);
56 const qint64 sleep = qBound<qint64>(0, ms, kMaxSleepMs) + kArmGuardMs;
57 m_timer.start(static_cast<int>(qMin<qint64>(sleep, kMaxSleepMs + kArmGuardMs)));
58}
59
60void NetScheduler::onTimeout()
61{

Callers

nothing calls this directly

Calls 7

nextReminderAcrossFunction · 0.85
beginMethod · 0.80
eraseMethod · 0.80
stopMethod · 0.45
sectionMethod · 0.45
isValidMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected