From 826ec02bf825b64cbff63a255bc5a9ab143878d2 Mon Sep 17 00:00:00 2001 From: Michael Lee <lee.5151@osu.edu> Date: Wed, 14 Aug 2024 11:40:14 -0400 Subject: [PATCH] adjust imagecacherender hook to reduce logs and adjust for cron run drift --- .../custom/imagecache_render/imagecache_render.module | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/web/modules/custom/imagecache_render/imagecache_render.module b/web/modules/custom/imagecache_render/imagecache_render.module index 0e3479d3b7..b428b6daf2 100644 --- a/web/modules/custom/imagecache_render/imagecache_render.module +++ b/web/modules/custom/imagecache_render/imagecache_render.module @@ -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, - ]); } } } -- GitLab