Set session ticker when calling Schedule

This commit is contained in:
Marcos Lilljedahl
2017-08-02 13:00:29 -03:00
parent c2b156d02a
commit cfb2ad01ca

View File

@@ -167,6 +167,7 @@ func (s *scheduler) Schedule(session *types.Session) error {
scheduledSession := s.register(session)
ctx, cancel := context.WithCancel(context.Background())
scheduledSession.cancel = cancel
scheduledSession.ticker = time.NewTicker(1 * time.Second)
go s.cron(ctx, scheduledSession)
return nil
}