@@ -34,17 +34,16 @@ type Scheduler interface {
3434 CancelJob (ctx context.Context , id string ) error
3535}
3636
37- type SchedulerConfig struct {
37+ type Config struct {
3838 ScheduleTime time.Duration `mapstructure:"scheduleTime"`
3939 JobTimeout time.Duration `mapstructure:"jobTimeout"`
4040 SourcePath string `mapstructure:"sourcePath"`
4141 DeleteSourceOnComplete bool `mapstructure:"deleteOnComplete"`
4242 MinFileSize int64 `mapstructure:"minFileSize"`
43- checksums map [string ][]byte
4443}
4544
4645type RuntimeScheduler struct {
47- config * SchedulerConfig
46+ config * Config
4847 repo repository.Repository
4948 checksumChan chan PathChecksum
5049 pathChecksumMap map [string ]string
@@ -57,7 +56,7 @@ func (r *RuntimeScheduler) RequestJob(ctx context.Context, workerName string) (*
5756 defer r .jobRequestMu .Unlock ()
5857 video , err := r .repo .RetrieveQueuedJob (ctx )
5958 if err != nil {
60- if errors .As (err , & repository .ErrElementNotFound ) {
59+ if errors .Is (err , repository .ErrElementNotFound ) {
6160 return nil , NoJobsAvailable
6261 }
6362 return nil , err
@@ -175,7 +174,7 @@ func (r *RuntimeScheduler) completeJob(ctx context.Context, jobEvent *model.Task
175174 return nil
176175}
177176
178- func NewScheduler (config * SchedulerConfig , repo repository.Repository ) (* RuntimeScheduler , error ) {
177+ func NewScheduler (config * Config , repo repository.Repository ) (* RuntimeScheduler , error ) {
179178 runtimeScheduler := & RuntimeScheduler {
180179 config : config ,
181180 repo : repo ,
0 commit comments