diff --git a/include/functions.inc.php b/include/functions.inc.php index 664a629f7..23b5a2140 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -3011,7 +3011,10 @@ SELECT function pwg_unique_exec_ends($token_name) { + global $logger; + conf_delete_param($token_name.'_running'); + $logger->info('['.$token_name.'] ends now'); } /** diff --git a/include/page_tail.php b/include/page_tail.php index 947091fe0..2e37a63b7 100644 --- a/include/page_tail.php +++ b/include/page_tail.php @@ -42,10 +42,16 @@ if ($conf['update_notify_check_period'] > 0) if ($check_for_updates) { - include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); - include_once(PHPWG_ROOT_PATH.'admin/include/updates.class.php'); - $updates = new updates(); - $updates->notify_piwigo_new_versions(); + $exec_id = pwg_unique_exec_begins('check_for_updates'); + if (false !== $exec_id) + { + include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); + include_once(PHPWG_ROOT_PATH.'admin/include/updates.class.php'); + $updates = new updates(); + $updates->notify_piwigo_new_versions(); + + pwg_unique_exec_ends('check_for_updates', $exec_id); + } } }