log errors storing persistance

This commit is contained in:
El RIDO 2021-06-16 05:32:45 +02:00
parent 3d9ba10fcb
commit fd08d991fe
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
3 changed files with 11 additions and 4 deletions

View File

@ -73,7 +73,10 @@ class PurgeLimiter extends AbstractPersistence
if ($pl + self::$_limit >= $now) { if ($pl + self::$_limit >= $now) {
return false; return false;
} }
self::$_store->setValue((string) $now, 'purge_limiter'); $hasStored = self::$_store->setValue((string) $now, 'purge_limiter');
return true; if (!$hasStored) {
error_log('failed to store the purge limiter, skipping purge cycle to avoid getting stuck in a purge loop');
}
return $hasStored;
} }
} }

View File

@ -65,7 +65,9 @@ class ServerSalt extends AbstractPersistence
self::$_salt = $salt; self::$_salt = $salt;
} else { } else {
self::$_salt = self::generate(); self::$_salt = self::generate();
self::$_store->setValue(self::$_salt, 'salt'); if (!self::$_store->setValue(self::$_salt, 'salt')) {
error_log('failed to store the server salt, delete tokens, traffic limiter and user icons won\'t work');
}
} }
return self::$_salt; return self::$_salt;
} }

View File

@ -172,7 +172,9 @@ class TrafficLimiter extends AbstractPersistence
$tl = time(); $tl = time();
$result = true; $result = true;
} }
self::$_store->setValue((string) $tl, 'traffic_limiter', $hash); if (!self::$_store->setValue((string) $tl, 'traffic_limiter', $hash)) {
error_log('failed to store the traffic limiter, it probably contains outdated information');
}
return $result; return $result;
} }
} }