From 3e0c7aa328ac721b3bcf17822f9ed3659ad93d14 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Tue, 4 May 2010 12:07:35 +0200 Subject: Add locking for indexer-based notifications --- lib/exe/indexer.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/exe/indexer.php') diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index eb5670005..7e55915f4 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -353,6 +353,9 @@ function sendDigest() { $olduser = $_SERVER['REMOTE_USER']; foreach($subscriptions as $id => $users) { + if (!subscription_lock($id)) { + continue; + } foreach($users as $data) { list($user, $style, $lastupdate) = $data; $lastupdate = (int) $lastupdate; @@ -399,6 +402,7 @@ function sendDigest() { // Update notification time. subscription_set($user, $id, $style, time(), true); } + subscription_unlock($id); } // restore current user info -- cgit v1.2.3