Class: Agent::Lock::CLI::Commands::ReleaseAll

Inherits:
TreeCommand
  • Object
show all
Defined in:
lib/agent/lock/cli/commands/release_all.rb

Overview

What a session should run when it finishes, so the next one does not have to work out whether it crashed.

Instance Attribute Summary

Attributes inherited from Base

#launcher

Instance Method Summary collapse

Methods inherited from TreeCommand

inherited

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Agent::Lock::CLI::Commands::Base

Instance Method Details

#call(**options) ⇒ Manager::Result

Returns with every record it released.

Parameters:

  • options (Hash) —

    :dir, :locking_strategy, :redis_url

Returns:



16
17
18
19
20
21
# File 'lib/agent/lock/cli/commands/release_all.rb', line 16

def call(**options)
  result = manager(options).release_all
  result.records.each { |record| say("RELEASED #{scope_of(record)}") }
  say("Released #{result.records.size} lock(s).")
  finish(result)
end