Skip to content

Commit

Permalink
rename idle_timeout_downstream to client_idle_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
abc3 committed Sep 18, 2023
1 parent 93d3632 commit d66a7de
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/supavisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ defmodule Supavisor do
ip_version: ip_ver,
default_pool_size: def_pool_size,
default_max_clients: def_max_clients,
idle_timeout_downstream: idle_timeout_downstream,
client_idle_timeout: client_idle_timeout,
users: [
%{
db_user: db_user,
Expand Down Expand Up @@ -213,7 +213,7 @@ defmodule Supavisor do
mode: mode,
default_parameter_status: ps,
max_clients: max_clients,
idle_timeout_downstream: idle_timeout_downstream
client_idle_timeout: client_idle_timeout
}

DynamicSupervisor.start_child(
Expand Down
2 changes: 1 addition & 1 deletion lib/supavisor/manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ defmodule Supavisor.Manager do
wait_ps: [],
default_parameter_status: args.default_parameter_status,
max_clients: args.max_clients,
idle_timeout: args.idle_timeout_downstream
idle_timeout: args.client_idle_timeout
}

{tenant, user, _mode} = args.id
Expand Down
4 changes: 2 additions & 2 deletions lib/supavisor/tenants/tenant.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule Supavisor.Tenants.Tenant do
field(:default_pool_size, :integer, default: 15)
field(:sni_hostname, :string)
field(:default_max_clients, :integer, default: 1000)
field(:idle_timeout_downstream, :integer, default: 0)
field(:client_idle_timeout, :integer, default: 0)

has_many(:users, User,
foreign_key: :tenant_external_id,
Expand Down Expand Up @@ -57,7 +57,7 @@ defmodule Supavisor.Tenants.Tenant do
:default_pool_size,
:sni_hostname,
:default_max_clients,
:idle_timeout_downstream
:client_idle_timeout
])
|> check_constraint(:upstream_ssl, name: :upstream_constraints, prefix: "_supavisor")
|> check_constraint(:upstream_verify, name: :upstream_constraints, prefix: "_supavisor")
Expand Down
2 changes: 1 addition & 1 deletion lib/supavisor_web/views/tenant_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule SupavisorWeb.TenantView do
auth_query: tenant.auth_query,
sni_hostname: tenant.sni_hostname,
default_max_clients: tenant.default_max_clients,
idle_timeout_downstream: tenant.idle_timeout_downstream,
client_idle_timeout: tenant.client_idle_timeout,
users: render_many(tenant.users, UserView, "user.json")
}
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
defmodule Supavisor.Repo.Migrations.AddClientIdleTimeout do
use Ecto.Migration

def change do
alter table("tenants", prefix: "_supavisor") do
add(:client_idle_timeout, :integer, null: false, default: 0)
end
end
end

This file was deleted.

0 comments on commit d66a7de

Please sign in to comment.