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

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

Instance Attribute Summary

Attributes inherited from Base

#s3_bucket

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #lambda_functions, #state_file

Methods included from Lambda::Functions

#lambda_functions

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::Worker::Base

Instance Method Details

#all_zeroed?Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
# File 'lib/jets/cli/maintenance/worker/zeroer.rb', line 11

def all_zeroed?
  lambda_functions.all? do |lambda_function|
    # check both reserved and provisioned
    lambda_function.provisioned_concurrency_unset? &&
      lambda_function.reserved_concurrency_zero?
  end
end

#zero_all_concurrencyObject



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

def zero_all_concurrency
  lambda_functions.each do |lambda_function|
    # must zero provisioned before reserved
    lambda_function.provisioned_concurrency = nil
    lambda_function.reserved_concurrency = 0
  end
end