mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-14 06:06:38 +01:00
fix: update metrics from sessions started via API (#1531)
fixes https://github.com/containrrr/watchtower/issues/1530
This commit is contained in:
parent
c16ac967c5
commit
87c5695e84
1 changed files with 4 additions and 1 deletions
|
|
@ -182,7 +182,10 @@ func Run(c *cobra.Command, names []string) {
|
||||||
httpAPI := api.New(apiToken)
|
httpAPI := api.New(apiToken)
|
||||||
|
|
||||||
if enableUpdateAPI {
|
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)
|
httpAPI.RegisterFunc(updateHandler.Path, updateHandler.Handle)
|
||||||
// If polling isn't enabled the scheduler is never started and
|
// If polling isn't enabled the scheduler is never started and
|
||||||
// we need to trigger the startup messages manually.
|
// we need to trigger the startup messages manually.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue