More transactions, more queries on uncommitted data

This commit is contained in:
Michael Vogel 2016-10-24 08:10:27 +00:00
parent 47b8975bb6
commit 8cab3b5592
6 changed files with 67 additions and 29 deletions

View file

@ -134,6 +134,8 @@ function cron_run(&$argv, &$argc){
} else {
proc_run(PRIORITY_LOW, 'include/dbclean.php');
}
cron_update_photo_albums();
}
// Clear cache entries
@ -155,6 +157,19 @@ function cron_run(&$argv, &$argc){
return;
}
/**
* @brief Update the cached values for the number of photo albums per user
*/
function cron_update_photo_albums() {
$r = q("SELECT `uid` FROM `user` WHERE NOT `account_expired` AND NOT `account_removed`");
if (!dbm::is_result($r))
return;
foreach ($r AS $user) {
photo_albums($user['uid'], true);
}
}
/**
* @brief Expire and remove user entries
*/