From b9a40ec445b9a9b8c0c85e76aeaa1ee57752ff73 Mon Sep 17 00:00:00 2001 From: Antoine Augusti Date: Thu, 19 Dec 2024 15:57:01 +0100 Subject: [PATCH] PR review --- apps/transport/lib/transport_web/plugs/worker_healthcheck.ex | 2 +- .../test/transport_web/plugs/worker_healthcheck_test.exs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/transport/lib/transport_web/plugs/worker_healthcheck.ex b/apps/transport/lib/transport_web/plugs/worker_healthcheck.ex index fedbc61644..269386d259 100644 --- a/apps/transport/lib/transport_web/plugs/worker_healthcheck.ex +++ b/apps/transport/lib/transport_web/plugs/worker_healthcheck.ex @@ -52,7 +52,7 @@ defmodule TransportWeb.Plugs.WorkerHealthcheck do def app_started_recently? do {delay, unit} = @app_start_waiting_delay - DateTime.before?(DateTime.utc_now(), DateTime.add(app_start_datetime(), delay, unit)) + DateTime.diff(DateTime.utc_now(), app_start_datetime(), unit) < delay end def app_start_datetime do diff --git a/apps/transport/test/transport_web/plugs/worker_healthcheck_test.exs b/apps/transport/test/transport_web/plugs/worker_healthcheck_test.exs index 61ef64db82..ce6da59f9d 100644 --- a/apps/transport/test/transport_web/plugs/worker_healthcheck_test.exs +++ b/apps/transport/test/transport_web/plugs/worker_healthcheck_test.exs @@ -1,5 +1,6 @@ defmodule TransportWeb.Plugs.WorkerHealthcheckTest do - # async: false is required because we use real in-memory caching in these tests + # async: false is required because we use real in-memory caching in these tests, + # and we swap application config (shared state) use TransportWeb.ConnCase, async: false alias TransportWeb.Plugs.WorkerHealthcheck