lib/hako/schedulers/ecs.rb in hako-1.7.0 vs lib/hako/schedulers/ecs.rb in hako-1.8.0
- old
+ new
@@ -1,8 +1,12 @@
# frozen_string_literal: true
-require 'aws-sdk'
+require 'aws-sdk-autoscaling'
+require 'aws-sdk-ec2'
+require 'aws-sdk-ecs'
+require 'aws-sdk-s3'
+require 'aws-sdk-sns'
require 'hako'
require 'hako/error'
require 'hako/scheduler'
require 'hako/schedulers/ecs_autoscaling'
require 'hako/schedulers/ecs_definition_comparator'
@@ -78,12 +82,10 @@
if task_definition_changed
Hako.logger.info "Registered task definition: #{task_definition.task_definition_arn}"
else
Hako.logger.info "Task definition isn't changed: #{task_definition.task_definition_arn}"
end
- unless current_service
- current_service = create_initial_service(task_definition.task_definition_arn, front_port)
- end
+ current_service ||= create_initial_service(task_definition.task_definition_arn, front_port)
service = update_service(current_service, task_definition.task_definition_arn)
if service == :noop
Hako.logger.info "Service isn't changed"
if @autoscaling
@autoscaling.apply(current_service)