Sha256: 422d9fcaec0baa854a9ba51051c0954b066d6120222e1977d2a18bd8349a3b8f

Contents?: true

Size: 662 Bytes

Versions: 4

Compression:

Stored size: 662 Bytes

Contents

class Jets::CLI::Maintenance
  class Worker < Base
    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

    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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jets-6.0.5 lib/jets/cli/maintenance/worker.rb
jets-6.0.4 lib/jets/cli/maintenance/worker.rb
jets-6.0.3 lib/jets/cli/maintenance/worker.rb
jets-6.0.2 lib/jets/cli/maintenance/worker.rb