From 1f0065117439aabfa5a3401a86bba39ce15d16ab Mon Sep 17 00:00:00 2001 From: Vincent Degove Date: Tue, 28 Jan 2025 14:08:11 +0100 Subject: [PATCH] better job delay not exactly twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Thibaut Barrère --- apps/transport/lib/transport/preemptive_api_cache.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/transport/lib/transport/preemptive_api_cache.ex b/apps/transport/lib/transport/preemptive_api_cache.ex index 1efac336da..c99ba2ba5c 100644 --- a/apps/transport/lib/transport/preemptive_api_cache.ex +++ b/apps/transport/lib/transport/preemptive_api_cache.ex @@ -7,7 +7,8 @@ defmodule Transport.PreemptiveAPICache do require Logger @job_delay :timer.seconds(300) - @cache_ttl :timer.seconds(600) + # slightly more than twice `@job_delay` to reduce the risk of parallel computation + @cache_ttl :timer.seconds(700) def cache_ttl, do: @cache_ttl