parseInt returns NaN on failure
This commit is contained in:
+3
-3
@@ -74,9 +74,9 @@ function getCronSeed() {
|
||||
minute = parseInt(tmp[1]);
|
||||
}
|
||||
|
||||
if ((hour === null || hour < 0 || hour > 23) || (minute === null || minute < 0 || minute > 60)) {
|
||||
hour = Math.floor(Math.random()*24);
|
||||
minute = Math.floor(60*Math.random());
|
||||
if ((isNaN(hour) || hour < 0 || hour > 23) || (isNaN(minute) || minute < 0 || minute > 60)) {
|
||||
hour = Math.floor(24 * Math.random());
|
||||
minute = Math.floor(60 * Math.random());
|
||||
|
||||
debug(`getCronSeed: writing new cron seed file with ${hour}:${minute} to ${paths.CRON_SEED_FILE}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user