Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 238 Bytes

README.md

File metadata and controls

17 lines (11 loc) · 238 Bytes

To solve running non-repeatable job in an autoscale cluster problem.

Usage:

lock:= dlock.NewDLock(db)

success := lock.Lock("task-1", 10*time.Minute)
if !success{
    return
}
defer lock.UnLock("task-1")

...do task-1 code...