Sha256: 0fcb55f844490a3e537ee3e182cb1141363ef24d74db15fece06f9b2b923dc55

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

namespace :website do
  namespace :backends do
    namespace :instances do
      environment_variables = <<-EOS
        Environment variables:
          (optional) $ID: the ID of the backend to alter.
                          Default: the backend last added.
      EOS
      
      desc <<-DESC
        Bump up the number of instances a backend. This adds one more process to
        the backend, allowing for processing more requests per second, but also
        consuming more memory.

        The default is 1. This tasks increments the current number by 1.

#{environment_variables}
      DESC
      task :more do
        backend = backends.fetch_current
        backend.post(:instances)
        puts "Number of instances of backend #{backend} scheduled for increase."
      end

      desc <<-DESC
        Decrease the number of instances of a backend.

#{environment_variables}
      DESC
      task :less do
        backend = backends.fetch_current
        backend.delete(:instances)
        puts "Number of instances of backend #{backend} scheduled for decrease."
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Flucti-flucti-cli-0.1.16 lib/flucti/tasks/website/backends/instances_tasks.rb