summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/api.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/statistics/api.inc.php')
-rw-r--r--modules-available/statistics/api.inc.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules-available/statistics/api.inc.php b/modules-available/statistics/api.inc.php
index 88b27d86..6f4917b0 100644
--- a/modules-available/statistics/api.inc.php
+++ b/modules-available/statistics/api.inc.php
@@ -220,6 +220,10 @@ if ($type[0] === '~') {
'oldlastseen' => $old['lastseen'],
'oldstate' => $old['state'],
);
+ if ($NOW - $old['lastseen'] < 10 && ($old['state'] === 'OFFLINE' || $old['state'] === 'STANDBY')) {
+ // Avoid racing calls to ~runstate updates while/after we send a ~poweroff or ~suspend
+ die("OK.\n");
+ }
if ($old['state'] === 'OFFLINE') {
// This should never happen -- we expect a poweron event before runstate, which would set the state to IDLE
// So it might be that the poweron event got lost, or that a couple of runstate events got lost, which