Skip to content

Commit

Permalink
Map: Remove cron option from cache key to match live key
Browse files Browse the repository at this point in the history
Previously the events that were cached from a live run were using a separate key than the events that were cached from a cron run. They need to use the same key in order for the cron job to do what it's intended to do.
  • Loading branch information
iandunn committed Nov 16, 2023
1 parent a3bdfc1 commit 67f489a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function render( array $attributes, string $content, WP_Block $block ): string {
*/
function get_events( string $filter_slug, int $start_timestamp, int $end_timestamp, bool $force_refresh = false ) : array {
$events = array();
$cache_key = 'google-map-event-filters-' . md5( wp_json_encode( func_get_args() ) );
$cache_key = 'google-map-event-filters-' . md5( wp_json_encode( $filter_slug . $start_timestamp . $end_timestamp ) );
$cached_events = get_transient( $cache_key );

if ( $cached_events && ! $force_refresh ) {
Expand Down

0 comments on commit 67f489a

Please sign in to comment.