mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Website: Update rituals script (#18211)
Closes: #17991 Changes: - Updated the create-issues-for-todays-rituals script to calculate the number of miliseconds until ritual issues should be created in whole milliseconds.
This commit is contained in:
parent
cfdce42970
commit
8159c2b44f
1 changed files with 2 additions and 2 deletions
|
|
@ -69,11 +69,11 @@ module.exports = {
|
|||
isItTimeToCreateANewIssue = true;
|
||||
} else {
|
||||
// Otherwise, get the number of milliseconds until the next issue for this ritual will be created.
|
||||
let timeToNextRitualInMs = amountOfCycleRemainingTillNextRitual * ritualsFrequencyInMs;
|
||||
let timeToNextRitualInMs = Math.floor(amountOfCycleRemainingTillNextRitual * ritualsFrequencyInMs);
|
||||
// Since this script runs once a day at the same time, we'll create issues we'll create issues for
|
||||
if(_.startsWith(ritual.frequency, 'Daily')) {// Using _.startsWith() to handle frequencies with emoji ("Daily ⏰") and with out ("Daily")
|
||||
isItTimeToCreateANewIssue = true;
|
||||
} else if(timeToNextRitualInMs < 86400000) {
|
||||
} else if(timeToNextRitualInMs <= 86400000) {
|
||||
// If the next occurance of this ritual is in less than 24 hours (before this script runs again), we'll create an issue for it.
|
||||
isItTimeToCreateANewIssue = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue