repeat-options.d.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { ParserOptions } from 'cron-parser';
  2. /**
  3. * Settings for repeatable jobs
  4. *
  5. * @see {@link https://docs.bullmq.io/guide/jobs/repeatable}
  6. */
  7. export interface RepeatOptions extends Omit<ParserOptions, 'iterator'> {
  8. /**
  9. * A repeat pattern
  10. */
  11. pattern?: string;
  12. /**
  13. * Custom repeatable key. This is the key that holds the "metadata"
  14. * of a given repeatable job. This key is normally auto-generated but
  15. * it is sometimes useful to specify a custom key for easier retrieval
  16. * of repeatable jobs.
  17. */
  18. key?: string;
  19. /**
  20. * Number of times the job should repeat at max.
  21. */
  22. limit?: number;
  23. /**
  24. * Repeat after this amount of milliseconds
  25. * (`pattern` setting cannot be used together with this setting.)
  26. */
  27. every?: number;
  28. /**
  29. * Repeated job should start right now
  30. * ( work only with cron settings)
  31. */
  32. immediately?: boolean;
  33. /**
  34. * The start value for the repeat iteration count.
  35. */
  36. count?: number;
  37. /**
  38. * Offset in milliseconds to affect the next iteration time
  39. * */
  40. offset?: number;
  41. /**
  42. * Internal property to store the previous time the job was executed.
  43. */
  44. prevMillis?: number;
  45. /**
  46. * Internal property to store the job id
  47. * @deprecated not in use anymore
  48. */
  49. jobId?: string;
  50. }