Skip to content

Commit f22ce8d

Browse files
committed
chore: lint fixes
1 parent 81a875f commit f22ce8d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

server/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ import (
77

88
type Config struct {
99
Database *repository.SQLServerConfig `mapstructure:"database"`
10-
Scheduler *scheduler.SchedulerConfig `mapstructure:"scheduler"`
10+
Scheduler *scheduler.Config `mapstructure:"scheduler"`
1111
}

server/scheduler/scheduler.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

4645
type 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

Comments
 (0)