From: k054 Date: Tue, 24 May 2016 14:59:52 +0000 (-0400) Subject: manual merging CRM/Contact/BAO/GroupContactCache.php X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=71f52f1b6adc6bdf5941f186d0655f33eed44316;p=civicrm-core.git manual merging CRM/Contact/BAO/GroupContactCache.php --- 71f52f1b6adc6bdf5941f186d0655f33eed44316 diff --cc CRM/Contact/BAO/GroupContactCache.php index b9da3338c8,f08284a69f..0782bf5463 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@@ -336,16 -334,12 +336,19 @@@ SET cache_date = null "; } else { + $query = " DELETE gc -FROM civicrm_group_contact_cache gc -INNER JOIN civicrm_group g ON g.id = gc.group_id -WHERE g.cache_date <= %1 ++ +FROM civicrm_group_contact_cache AS gc +INNER JOIN ( + SELECT id + FROM civicrm_group + WHERE TIMESTAMPDIFF(MINUTE, cache_date, $now) >= $smartGroupCacheTimeout + LIMIT $deleteLimit + ) AS g +ON g.id=gc.group_id ++ "; $update = " UPDATE civicrm_group g