Skip to content
Snippets Groups Projects
Commit 826ec02b authored by Michael Lee's avatar Michael Lee
Browse files

adjust imagecacherender hook to reduce logs and adjust for cron run drift

parent 4677c305
No related branches found
No related tags found
1 merge request!162adjust ImagecacheRender hook to reduce logs and adjust for cron run drift
......@@ -62,15 +62,11 @@ function imagecache_render_imagecache_external_needs_refresh_alter(&$needs_refre
date_default_timezone_set('America/New_York');
$current_hour = (int) date('G');
if ($current_hour >= 3 && $current_hour < 5) {
if (filemtime($filepath) < \Drupal::time()->getRequestTime() - 60 * 60 * 24) {
if (filemtime($filepath) < \Drupal::time()->getRequestTime() - 60 * 60 * 24 - (30 * 60)) {
\Drupal::logger('imagecache_external')->notice('@filepath older than 24 hours, refreshing', [
'@filepath' => $filepath,
]);
$needs_refresh = TRUE;
} else {
\Drupal::logger('imagecache_external')->notice('@filepath is less than 24 hours. Will not refresh.', [
'@filepath' => $filepath,
]);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment