Flip logic

This commit is contained in:
Phil Constantinou 2024-06-26 15:55:52 +02:00
parent d05bf4edf8
commit f7da9f3903

View file

@ -943,7 +943,7 @@ func (p *PgBackend) handleJob(ctx context.Context, jobID string) (err error) {
ctx = jobs.WithJobContext(ctx, job)
ctx = context.WithValue(ctx, txCtxVarKey, tx)
if job.RunAfter.After(time.Now()) {
if job.RunAfter.Before(time.Now()) {
p.logger.Error("Running a job too early.",
slog.String("queue", job.Queue),
slog.Int64("job_id", job.ID),