Fix bug with max worker jobs
Fix bug where it was possible to set max scanner worker jobs to 0, resulting in the scanner not processing any jobs.
This commit is contained in:
parent
467ec54797
commit
b133a1846c
|
@ -64,8 +64,8 @@ func (r *mutationResolver) SetPeriodicScanInterval(ctx context.Context, interval
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *mutationResolver) SetScannerConcurrentWorkers(ctx context.Context, workers int) (int, error) {
|
func (r *mutationResolver) SetScannerConcurrentWorkers(ctx context.Context, workers int) (int, error) {
|
||||||
if workers < 0 {
|
if workers < 1 {
|
||||||
return 0, errors.New("concurrent workers must be positive")
|
return 0, errors.New("concurrent workers must at least be 1")
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := r.Database.Exec("UPDATE site_info SET concurrent_workers = ?", workers)
|
_, err := r.Database.Exec("UPDATE site_info SET concurrent_workers = ?", workers)
|
||||||
|
|
Loading…
Reference in New Issue