mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
log errors storing persistance
This commit is contained in:
parent
3d9ba10fcb
commit
fd08d991fe
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user