Skip to content

Commit

Permalink
fixup! Support configuring a default tenant when running in any envir…
Browse files Browse the repository at this point in the history
…onment, dev and test included
  • Loading branch information
alco committed Oct 17, 2024
1 parent 5971de7 commit 747e789
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions packages/sync-service/lib/electric/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ defmodule Electric.Application do

router_opts =
Enum.concat([
[tanent_manager: Electric.TenantManager],
[
tanent_manager: Electric.TenantManager,
long_poll_timeout: 20_000,
max_age: Application.fetch_env!(:electric, :cache_max_age),
stale_age: Application.fetch_env!(:electric, :cache_stale_age),
allow_shape_deletion: Application.get_env(:electric, :allow_shape_deletion, false)
],
get_service_status_option(config.electric_instance_id, tenant_id)
])

Expand Down Expand Up @@ -53,20 +59,6 @@ defmodule Electric.Application do
plug: {Electric.Plug.Router, router_opts},
port: Application.fetch_env!(:electric, :service_port),
thousand_island_options: http_listener_options()}
# {Bandit,
# plug:
# {Electric.Plug.Router,
# storage: config.storage,
# registry: Registry.ShapeChanges,
# shape_cache: {Electric.ShapeCache, config.shape_cache_opts},
# get_service_status: &Electric.ServiceStatus.check/0,
# inspector: config.inspector,
# long_poll_timeout: 20_000,
# max_age: Application.fetch_env!(:electric, :cache_max_age),
# stale_age: Application.fetch_env!(:electric, :cache_stale_age),
# allow_shape_deletion: Application.get_env(:electric, :allow_shape_deletion, false)},
# port: Application.fetch_env!(:electric, :service_port),
# thousand_island_options: http_listener_options()}
],
prometheus_endpoint(Application.fetch_env!(:electric, :prometheus_port))
])
Expand Down

0 comments on commit 747e789

Please sign in to comment.