mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
Allow running periodic updates with enabled HTTP API (#916)
* Allow running periodic updates with enabled HTTP API * Add --http-api-periodic-polls to docs
This commit is contained in:
parent
e308521a95
commit
6b155a111a
6 changed files with 55 additions and 12 deletions
|
@ -13,9 +13,13 @@ var (
|
|||
)
|
||||
|
||||
// New is a factory function creating a new Handler instance
|
||||
func New(updateFn func()) *Handler {
|
||||
lock = make(chan bool, 1)
|
||||
lock <- true
|
||||
func New(updateFn func(), updateLock chan bool) *Handler {
|
||||
if updateLock != nil {
|
||||
lock = updateLock
|
||||
} else {
|
||||
lock = make(chan bool, 1)
|
||||
lock <- true
|
||||
}
|
||||
|
||||
return &Handler{
|
||||
fn: updateFn,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue