Skip to content

Commit

Permalink
fix: update metrics from sessions started via API (#1531)
Browse files Browse the repository at this point in the history
fixes #1530
  • Loading branch information
SamKirsch10 committed Jan 22, 2023
1 parent c16ac96 commit 87c5695
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 87c5695

Please sign in to comment.