Skip to content

Commit

Permalink
daemon: send action 3 times at the startup
Browse files Browse the repository at this point in the history
Signed-off-by: Date Huang <[email protected]>
  • Loading branch information
tjjh89017 committed Jan 31, 2025
1 parent cafbb74 commit a77e21a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,16 @@ func (d *Daemon) Run(ctx context.Context) {
}()

d.bootCtrl.Execute(daemonCtx)
go d.refreshCtrl.Execute(daemonCtx)
go d.publishCtrl.Execute(daemonCtx)

go func() {
// burst 3 time at startup
for range 3 {
go d.refreshCtrl.Execute(daemonCtx)
go d.publishCtrl.Execute(daemonCtx)
time.Sleep(time.Second * 15)
}
}()

d.logger.Info().Msgf("daemon started with refresh interval %s", d.config.RefreshInterval)

ticker := time.NewTicker(d.config.RefreshInterval)
Expand Down

0 comments on commit a77e21a

Please sign in to comment.