mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
do some decent context reworking
This commit is contained in:
2
timer.go
2
timer.go
@@ -45,7 +45,6 @@ func (t *Timer) Type() string {
|
||||
}
|
||||
|
||||
func (t *Timer) RegisterRouter(router *Router) {
|
||||
slog.Debug("registering router", "id", t.config.Id)
|
||||
t.router = router
|
||||
}
|
||||
|
||||
@@ -56,6 +55,7 @@ func (t *Timer) Run(ctx context.Context) error {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
t.timer.Stop()
|
||||
slog.Debug("router context done in module", "id", t.config.Id)
|
||||
return nil
|
||||
case time := <-t.timer.C:
|
||||
if t.router != nil {
|
||||
|
||||
Reference in New Issue
Block a user