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