Skip to content

Commit ccb9504

Browse files
committed
set opts for stack ready timeout and disabling cache headers
though currently the cache headers flag won't do anything
1 parent de50e44 commit ccb9504

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/phoenix/sync/electric.ex

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,17 @@ defmodule Phoenix.Sync.Electric do
299299
defp core_configuration(env, opts) do
300300
opts
301301
|> env_defaults(env)
302+
|> overrides()
302303
|> stack_id()
303304
end
304305

305306
defp env_defaults(opts, :dev) do
306-
Keyword.put_new(
307-
opts,
307+
opts
308+
|> Keyword.put_new(
308309
:storage_dir,
309310
Path.join(System.tmp_dir!(), "electric/shape-data#{System.monotonic_time()}")
310311
)
312+
|> Keyword.put_new(:send_cache_headers?, false)
311313
end
312314

313315
defp env_defaults(opts, :test) do
@@ -331,6 +333,11 @@ defmodule Phoenix.Sync.Electric do
331333
opts
332334
end
333335

336+
defp overrides(opts) do
337+
opts
338+
|> Keyword.put_new(:stack_ready_timeout, 5_000)
339+
end
340+
334341
# Returns a function to generate the config so that we can
335342
# centralise the test for the existance of electric.
336343
# Need this because the convert_repo_config/1 function needs Electric

0 commit comments

Comments
 (0)