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

Inherits:
Base
  • Object
show all
Includes:
Lambda::Functions
Defined in:
lib/jets/cli/maintenance/worker/base.rb

Direct Known Subclasses

Restorer, Saver, Zeroer

Instance Attribute Summary collapse

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#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

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



6
7
8
9
# File 'lib/jets/cli/maintenance/worker/base.rb', line 6

def initialize(options = {})
  super
  @s3_bucket = Jets.aws.s3_bucket
end

Instance Attribute Details

#s3_bucketObject (readonly)

Returns the value of attribute s3_bucket.



5
6
7
# File 'lib/jets/cli/maintenance/worker/base.rb', line 5

def s3_bucket
  @s3_bucket
end

Instance Method Details

#lambda_functionsObject



15
16
17
18
19
20
# File 'lib/jets/cli/maintenance/worker/base.rb', line 15

def lambda_functions
  super.select do |lambda_function|
    # Accounts for both app/events and app/jobs (from jets geneneration)
    lambda_function.name.match(/_event-/)
  end
end

#state_fileObject



11
12
13
# File 'lib/jets/cli/maintenance/worker/base.rb', line 11

def state_file
  "jets/state/maintenance/lambda_concurrency_settings.json"
end