8000 Change naming of var to be clear that it's not a function but a boolean. · github4f/node-cron@20e945e · GitHub
[go: up one dir, main page]

Skip to content

Commit 20e945e

Browse files
committed
Change naming of var to be clear that it's not a function but a boolean.
Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
1 parent 344ce9b commit 20e945e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,14 @@ Parameter Based
146146

147147
`CronJob`
148148

149-
* `constructor(cronTime, onTick, onComplete, start, timezone, context, onInit)` - Of note, the first parameter here can be a JSON object that has the below names and associated types (see examples above).
149+
* `constructor(cronTime, onTick, onComplete, start, timezone, context, runOnInit)` - Of note, the first parameter here can be a JSON object that has the below names and associated types (see examples above).
150150
* `cronTime` - [REQUIRED] - The time to fire off your job. This can be in the form of cron syntax or a JS [Date](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date) object.
151151
* `onTick` - [REQUIRED] - The function to fire at the specified time.
152152
* `onComplete` - [OPTIONAL] - A function that will fire when the job is complete, when it is stopped.
153153
* `start` - [OPTIONAL] - Specifies whether to start the job just before exiting the constructor. By default this is set to false. If left at default you will need to call `job.start()` in order to start the job (assuming `job` is the variable you set the cronjob to). This does not immediately fire your `onTick` function, it just gives you more control over the behavior of your jobs.
154154
* `timeZone` - [OPTIONAL] - Specify the timezone for the execution. This will modify the actual time relative to your timezone.
155155
* `context` - [OPTIONAL] - The context within which to execute the onTick method. This defaults to the cronjob itself allowing you to call `this.stop()`. However, if you change this you'll have access to the functions and values within your context object.
156-
* `onInit` - [OPTIONAL] - This will immediately fire your `onTick` function as soon as the requisit initialization has happened. This option is set to `false` by default for backwards compatability.
156+
* `runOnInit` - 8000 [OPTIONAL] - This will immediately fire your `onTick` function as soon as the requisit initialization has happened. This option is set to `false` by default for backwards compatability.
157157
* `start` - Runs your job.
158158
* `stop` - Stops your job.
159159

lib/cron.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ function CronJob(cronTime, onTick, onComplete, startNow, timeZone, context, runO
355355
context = cronTime.context;
356356
startNow = cronTime.start || cronTime.startNow || cronTime.startJob;
357357
timeZone = cronTime.timeZone;
358-
runOnInit = cronTime.onInit;
358+
runOnInit = cronTime.runOnInit;
359359
_cronTime = cronTime.cronTime;
360360
}
361361

0 commit comments

Comments
 (0)
0