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.
Files changed (2) hide show
  1. package/index.js +6 -0
  2. 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-to-noforeignland",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "SignalK track logger to noforeignland.com",
5
5
  "main": "index.js",
6
6
  "keywords": [