Browse Source

log nb_jobs only when number of jobs is larger than 0 in scheduler.

Shizun Ge 2 years ago
parent
commit
f3f892f448
1 changed files with 1 additions and 1 deletions
  1. 1 1
      internal/cli/scheduler.go

+ 1 - 1
internal/cli/scheduler.go

@@ -40,7 +40,7 @@ func feedScheduler(store *storage.Storage, pool *worker.Pool, frequency, batchSi
 
 		if jobs, err := batchBuilder.FetchJobs(); err != nil {
 			slog.Error("Unable to fetch jobs from database", slog.Any("error", err))
-		} else {
+		} else if len(jobs) > 0 {
 			slog.Info("Created a batch of feeds",
 				slog.Int("nb_jobs", len(jobs)),
 			)