Set session ticker when calling Schedule
This commit is contained in:
@@ -167,6 +167,7 @@ func (s *scheduler) Schedule(session *types.Session) error {
|
|||||||
scheduledSession := s.register(session)
|
scheduledSession := s.register(session)
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
scheduledSession.cancel = cancel
|
scheduledSession.cancel = cancel
|
||||||
|
scheduledSession.ticker = time.NewTicker(1 * time.Second)
|
||||||
go s.cron(ctx, scheduledSession)
|
go s.cron(ctx, scheduledSession)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user