Skip to content

Commit 56e3aef

Browse files
Updated sheduler code error channel
1 parent ba70c0a commit 56e3aef

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

internal/scheduler/scheduler.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import (
1212
"go.uber.org/zap"
1313
)
1414

15-
/*
16-
initialized a scheduler of Schedular type as a goroutine with context
17-
when ctx.Done() is recieved, scheduler starts shutting down
18-
the main function waits till wg.Done() is not called ensuring complete shutdown of scheduler
19-
in case of any error, the errCh is used to propogate it back to main function where it's handled
15+
/*
16+
initialized a scheduler of Scheduler type as a goroutine with context
17+
when ctx.Done() is recieved, scheduler starts shutting down
18+
the main function waits till wg.Done() is not called ensuring complete shutdown of scheduler
19+
in case of any error, the errCh is used to propogate it back to main function where it's handled
2020
*/
21-
func InitSchedular(ctx context.Context, sched Scheduler, wg *sync.WaitGroup, errCh chan<-error) {
21+
func InitScheduler(ctx context.Context, sched Scheduler, wg *sync.WaitGroup, errCh chan<- error) {
2222
wg.Add(1)
2323
go func(ctx context.Context) {
2424
defer wg.Done()
@@ -30,7 +30,7 @@ func InitSchedular(ctx context.Context, sched Scheduler, wg *sync.WaitGroup, err
3030
zap.Error(err),
3131
)
3232
} else {
33-
zap.L().Info("Schedular Stopped Gracefully")
33+
zap.L().Info("Scheduler Stopped Gracefully")
3434
}
3535
}(ctx)
3636
}

0 commit comments

Comments
 (0)