Class ScheduledJobs

java.lang.Object
com.kingsrook.qqq.backend.core.jobs.ScheduledJobs

public final class ScheduledJobs extends Object
Scheduled processes as durable jobs (spec section 2.4, "Scheduled"). A scheduled run becomes a job when durable jobs are on, the instance's scheduledRunsAsJobs is true (the default), and the process opted in: it is alwaysDurable, explicitly eligible in its durable meta data, or named in the instance's eligibleProcessNames. (Processes that are only eligible by kind, such as any streamed ETL, keep running inline when scheduled.) The job is owned by the scheduler's user, or, when the scheduler runs as the system user, by DurableJobsMetaData.scheduledJobsUserId. Without an owner the run stays inline, as it was before durable jobs.
  • Field Details

  • Method Details

    • runsAsJob

      public static boolean runsAsJob(QProcessMetaData process)
      Whether a scheduled run of this process becomes a job.
    • launchIfDurable

      public static Integer launchIfDurable(QProcessMetaData process, Map<String,Serializable> values) throws QException
      When a scheduled run of the process should be a job, launch it and return the job id. Null means: run it inline, as before. A launch that fails (for example, over the queue cap) throws; the caller logs it and skips this run, the next schedule tick tries again.
      Throws:
      QException