From 7d5540de7159afee716a64a54519abae81b9b001 Mon Sep 17 00:00:00 2001 From: Coby Benveniste Date: Tue, 7 Jan 2025 20:58:55 +0200 Subject: [PATCH] Set the timeout to max between itself and the boot_timeout --- lib/flame/runner.ex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/flame/runner.ex b/lib/flame/runner.ex index 5dd2649..264dde8 100644 --- a/lib/flame/runner.ex +++ b/lib/flame/runner.ex @@ -363,6 +363,9 @@ defmodule FLAME.Runner do other when other in [{:ok, nil}, :error] -> {30_000, fn -> true end} end + timeout = opts[:timeout] || 30_000 + boot_timeout = opts[:boot_timeout] || 30_000 + runner = %Runner{ status: :awaiting_boot, @@ -370,8 +373,8 @@ defmodule FLAME.Runner do backend_init: :pending, log: Keyword.get(opts, :log, false), single_use: Keyword.get(opts, :single_use, false), - timeout: opts[:timeout] || 30_000, - boot_timeout: opts[:boot_timeout] || 30_000, + timeout: max(timeout, boot_timeout), + boot_timeout: boot_timeout, shutdown_timeout: opts[:shutdown_timeout] || 30_000, idle_shutdown_after: idle_shutdown_after_ms, idle_shutdown_check: idle_check,