Class: Jets::CLI::Maintenance::Worker

Inherits:
Base
  • Object
show all
Defined in:
lib/jets/cli/maintenance/worker.rb,
lib/jets/cli/maintenance/worker/base.rb,
lib/jets/cli/maintenance/worker/saver.rb,
lib/jets/cli/maintenance/worker/zeroer.rb,
lib/jets/cli/maintenance/worker/restorer.rb

Defined Under Namespace

Classes: Base, Restorer, Saver, Zeroer

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #status

Methods included from Util::Truthy

#truthy?

Methods included from Lambda::Checks

#check_deployed!, #check_workers!, #workers_deployed?

Methods inherited from Base

#initialize, #paginate, #paging_params, rescue_api_error

Methods included from Util::Logging

#log

Methods included from AwsServices

#apigateway, #aws_options, #cfn, #codebuild, #dynamodb, #lambda_client, #logs, #s3, #s3_resource, #sns, #sqs, #ssm, #sts, #wafv2

Methods included from AwsServices::StackStatus

#output_value, #stack_exists?

Methods included from AwsServices::GlobalMemoist

included, #reset_cache!

Methods included from Api

#api, #api_key

Constructor Details

This class inherits a constructor from Jets::CLI::Maintenance::Base

Instance Method Details

#offObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/jets/cli/maintenance/worker.rb', line 15

def off
  check_workers!

  if on?
    Restorer.new(@options).restore_concurrency_settings
    warn "Worker maintenance has been turned off"
  else
    warn "Worker maintenance is already off"
  end
end

#onObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/jets/cli/maintenance/worker.rb', line 3

def on
  check_workers!

  if on?
    warn "Worker maintenance is already on"
  else
    Saver.new(@options).save_concurrency_settings
    Zeroer.new(@options).zero_all_concurrency
    warn "Worker maintenance has been turned on"
  end
end

#on?Boolean

Returns:

  • (Boolean)


26
27
28
29
# File 'lib/jets/cli/maintenance/worker.rb', line 26

def on?
  check_workers!
  Zeroer.new(@options).all_zeroed?
end