mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-15 19:20:47 +01:00
rate limit notifications push-message-cleanup to once per hour as they lock the notifications table and block each other
This commit is contained in:
parent
2356c6e0dd
commit
92ffca5a7a
@ -121,6 +121,14 @@ class notifications_push implements Json\PushBackend
|
|||||||
*/
|
*/
|
||||||
protected static function cleanup_push_msgs()
|
protected static function cleanup_push_msgs()
|
||||||
{
|
{
|
||||||
|
// rate limit the deletes: max. once per hour for the instance
|
||||||
|
$stamp = date('YmdH');
|
||||||
|
if (Api\Cache::getInstance(__CLASS__, __FUNCTION__) === $stamp)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Api\Cache::setInstance(__CLASS__, __FUNCTION__, $stamp);
|
||||||
|
|
||||||
if (($ts = self::$db->from_unixtime(Api\Session::heartbeat_limit())))
|
if (($ts = self::$db->from_unixtime(Api\Session::heartbeat_limit())))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user