import type { TimeSpan } from 'src/NodeJS/types'; /** Settings for the job worker. */ export interface IJobWorkerSettings { /** Gets or sets the initial delay of the worker. Defaults to 30. */ initialDelaySeconds: number; /** Gets or sets the amount of seconds to wait before checking if a job is available. */ jobPollingIntervalSeconds: number; /** Gets or sets a timespan that determines the due date of the job that is added after a job finished work. */ addNextJobAfter?: TimeSpan; /** Gets or sets the type of jobs the runner consumes. */ jobType: string; /** * Gets or sets a value indicating whether a new job should be added on the start of the worker if no job exists in * the db. */ addInitialJob: boolean; /** Gets or sets a value indicating whether the worker should delete jobs that are older than the given timespan. */ deleteJobsOlderThan?: TimeSpan; /** * Gets or sets the amount of minutes a job is considered stuck and should be removed. When set, the worker will * check existing jobs one time when starting. If any job is running but was updated more than the given amount of * minutes ago, the job is considered stuck and will be removed. If is set, the worker * will then add a new pending job. */ resetJobsStuckForMinutes?: number; }