class

Meridian::Lock::Manager

Inherits Reference < Object

A simple remote deploy lock. Acquisition is atomic because it relies on mkdir of the lock directory, which fails on any host filesystem when the directory already exists. Lock metadata is stored as a small JSON file inside that directory. SSH, time, and actor dependencies are injectable for specs.

Constructors

new(config : Config::DeployConfig, ssh_executor : SSH::Executor = SSH::Executor.new, output : IO = STDOUT, clock : Proc(Time) = -> do Time.utc end, actor : Proc(String) = -> do Audit.default_actor end, audit_logger : Audit::Logger | Nil = nil)
Source

Instance methods

acquire(message : String | Nil = nil) : Runtime::LockMetadata

Atomically claim the deploy lock. Raises LockHeld if another caller already holds it.

Source
lock_host

The host that owns the deploy lock - the first web host when present, otherwise the first configured host of any role.

Source
release(*, announce : Bool = true) : Runtime::LockMetadata | Nil

Release the deploy lock. A stale lock is only ever cleared by an explicit release - never silently - and the released lock is announced.

Source
status
Source

Nested types