module Prostore::Migration::Lease

Overview

Lease-based mutex for migrations (ADR-0009 invariant 5).

Extended Modules

Defined in:

prostore/migration/lease.cr

Constant Summary

DEFAULT_DURATION = 5.minutes

Instance Method Summary

Instance Method Detail

def claim(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String, duration : Time::Span = DEFAULT_DURATION) : Bool #

Returns true if the lease was successfully claimed; false if another live lease is held.


[View source]
def heartbeat(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String, duration : Time::Span = DEFAULT_DURATION) : Bool #

[View source]
def release(adapter, executor : Adapter::Base::Executor, migration_id : Int64, runner_id : String) : Nil #

[View source]
def runner_id : String #

[View source]