Pulse
GithubCloud(Pulsecron)
  • What is Pulse?
  • Why Pulse?
  • Quick Start
  • DOCS
    • Setup & Config
      • Connection
      • Config
        • Name
        • ProcessEvery
        • DefaultConcurrency
        • MaxConcurrency
        • LockLimit
        • DefaultLockLimit
        • DefaultLockLifetime
        • Sort
        • ResumeOnRestart
    • Defining Job Processors
    • Managing Job Processor
      • Start
      • Stop
    • Creating Jobs
      • Every
      • Schedule
      • Now
      • Create
    • Managing Jobs
      • Jobs
      • Cancel
      • Disable
      • Enable
      • Purge
      • isRunning
      • isExpired
      • Manually working
        • Save
        • Unique
        • RepeatEvery
        • RepeatAt
        • Schedule
        • Remove
        • Priority
        • Touch
        • SetShouldSaveResult
        • Fail
        • Run
        • Disable
        • Enable
Powered by GitBook
On this page
  • job.schedule(time)
  • Example Usage
  • Parameters
  • Returns

Was this helpful?

Edit on GitHub
  1. DOCS
  2. Managing Jobs
  3. Manually working

Schedule

PreviousRepeatAtNextRemove

Last updated 1 year ago

Was this helpful?

job.schedule(time)

The schedule method sets a job to run at a specific time determined by the input parameter. This method accepts both Date objects and date strings, providing flexibility in scheduling jobs.

This does NOT save the job in the database. you must explicitly declare if you want to save it

Example Usage

const job = pulse.create('test', {});
job.schedule(new Date(2023, 11, 17, 10, 30));  
await job.save(); // If you want to save it

Parameters

  • time (string | Date): The time at which the job is scheduled to run. This can be a Date object representing the exact time for the job to run.

Returns

  • Job: Returns the job instance with the updated nextRunAt attribute, allowing for method chaining.

save()