Class: Agent::Lock::CLI::Commands::Resume

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

Overview

Pick up work a reboot or a crash interrupted.

A lock whose holder died is orphaned rather than deleted when it has notes in it. This takes it back, prints what the last session wrote, and makes it a live claim again under the current identity.

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(scope:, **options) ⇒ Manager::Result

Returns :resumed, :not_found, :held or :interrupted.

Parameters:

  • scope (String)
  • options (Hash) —

    :dir, :locking_strategy, :redis_url

Returns:



24
25
26
27
28
29
# File 'lib/agent/lock/cli/commands/resume.rb', line 24

def call(scope:, **options)
  manager = manager(options)
  result = manager.resume(scope)
  report(result, scope, manager.stale_minutes)
  finish(result)
end