mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-17 15:40:12 +01:00
Fix metric updates when invoked via HTTP API
This commit is contained in:
parent
c16ac967c5
commit
8fff7ca6e8
1 changed files with 4 additions and 1 deletions
|
|
@ -182,7 +182,10 @@ func Run(c *cobra.Command, names []string) {
|
|||
httpAPI := api.New(apiToken)
|
||||
|
||||
if enableUpdateAPI {
|
||||
updateHandler := update.New(func(images []string) { runUpdatesWithNotifications(filters.FilterByImage(images, filter)) }, updateLock)
|
||||
updateHandler := update.New(func(images []string) {
|
||||
metric := runUpdatesWithNotifications(filters.FilterByImage(images, filter))
|
||||
metrics.RegisterScan(metric)
|
||||
}, updateLock)
|
||||
httpAPI.RegisterFunc(updateHandler.Path, updateHandler.Handle)
|
||||
// If polling isn't enabled the scheduler is never started and
|
||||
// we need to trigger the startup messages manually.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue