signalk-to-noforeignland 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -471,6 +471,12 @@ module.exports = function (app) {
|
|
|
471
471
|
}
|
|
472
472
|
await fs.rm(path.join(options.trackDir, routeSaveName));
|
|
473
473
|
}
|
|
474
|
+
//every 10 minute but staggered to the second so we don't all send at once.
|
|
475
|
+
if (!options.emailCron || options.emailCron === '*/10 * * * *') {
|
|
476
|
+
const startMinute = Math.floor(Math.random() * 10); // Random minute within the 10-minute range
|
|
477
|
+
const startSecond = Math.floor(Math.random() * 60); // Random second within the minute
|
|
478
|
+
options.emailCron = `${startSecond} ${startMinute}/10 * * * *`; // Every 10 minutes, starting at a random minute and second within each 10-minute block
|
|
479
|
+
}
|
|
474
480
|
|
|
475
481
|
upSince = new Date().getTime();
|
|
476
482
|
|