From 2b08519f5ad2cf7803736b42159f92f754acb0bd Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 28 Nov 2019 08:22:53 +0000 Subject: sse: improve caching fix an issue with removing notifications and move chatpresence expiration to cron --- Zotlabs/Daemon/Cron.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Zotlabs/Daemon/Cron.php') diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php index 8fa31e6ce..bd4e0b294 100644 --- a/Zotlabs/Daemon/Cron.php +++ b/Zotlabs/Daemon/Cron.php @@ -40,6 +40,15 @@ class Cron { require_once('include/sharedwithme.php'); apply_updates(); + + /** + * Chatpresence: if somebody hasn't pinged recently, they've most likely left the page + * and shouldn't count as online anymore. We allow an expection for bots. + */ + q("delete from chatpresence where cp_last < %s - INTERVAL %s and cp_client != 'auto' ", + db_utcnow(), + db_quoteinterval('3 MINUTE') + ); // expire any expired mail -- cgit v1.2.3