Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/services/autoscale_servers_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def inner_call

adapter.apply_instance_counts(
[
{ group: :web, type: :small, count: web_scaling_target },
{ group: :web, type: web_scaling_target == MIN_INSTANCES ? :small : :medium, count: web_scaling_target },
{ group: :worker, type: worker_instance_type, count: worker_scaling_target }
]
)
Expand Down
6 changes: 6 additions & 0 deletions app/services/hosting_service_adapters/fly.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class HostingServiceAdapters::Fly < HostingServiceAdapters::Base
SMALL_GUEST = { "cpu_kind" => "shared", "cpus" => 1, "memory_mb" => 512 }
MEDIUM_GUEST = { "cpu_kind" => "shared", "cpus" => 4, "memory_mb" => 1024 }
LARGE_GUEST = { "cpu_kind" => "performance", "cpus" => 1, "memory_mb" => 2048 }

class Machine < HostingServiceAdapters::Instance
Expand Down Expand Up @@ -62,6 +63,7 @@ def machines_api
builder.request :json
builder.response :json
builder.response :raise_error
builder.response :logger, nil, { headers: true, bodies: true, errors: true }
end
end

Expand Down Expand Up @@ -93,6 +95,8 @@ def instance_for_machine(machine) # rubocop:disable Metrics/MethodLength
case guest
when SMALL_GUEST
:small
when MEDIUM_GUEST
:medium
when LARGE_GUEST
:large
else
Expand All @@ -105,6 +109,8 @@ def guest_config_for_type(type)
case type
when :small
SMALL_GUEST
when :medium
MEDIUM_GUEST
when :large
LARGE_GUEST
end
Expand Down
11 changes: 8 additions & 3 deletions app/services/hosting_service_adapters/heroku.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ def instances_state # rubocop:disable Metrics/MethodLength

type =
case dyno_group["dyno_size"]["name"]
when "eco", "basic", "standard-1X"
when "eco", "basic"
:small
when "standard-1X"
:medium
when "standard-2X"
:large
else
Expand All @@ -46,9 +48,12 @@ def update_instance_group(group:, type:, count:)
end

dyno_size =
if type == :small
case type
when :small
count == 1 ? "basic" : "standard-1X"
elsif type == :large
when :medium
"standard-1X"
when :largerge
"standard-2X"
end

Expand Down
Loading