worldstate-emitter 2.2.9 → 2.2.11

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.
@@ -3,14 +3,12 @@ import wsData from 'warframe-worldstate-data';
3
3
  import WSCache from '../utilities/WSCache.js';
4
4
  import { logger, lastUpdated } from '../utilities/index.js';
5
5
  import Cache from '../utilities/Cache.js';
6
- import { SENTIENT_URL, KUVA_URL, WORLDSTATE_URL } from '../resources/config.js';
6
+ import { sentientUrl, kuvaUrl, worldstateUrl, externalCron, worldstateCron } from '../resources/config.js';
7
7
 
8
8
  import parseNew from './events/parse.js';
9
9
 
10
10
  const { locales } = wsData;
11
-
12
11
  const debugEvents = ['arbitration', 'kuva', 'nightwave'];
13
- const smCron = `0 */10 * * * *`;
14
12
 
15
13
  /**
16
14
  * Handler for worldstate data
@@ -38,9 +36,9 @@ export default class Worldstate {
38
36
  }
39
37
 
40
38
  async init() {
41
- this.#wsRawCache = await Cache.make(WORLDSTATE_URL, '*/10 * * * * *');
42
- this.#kuvaCache = await Cache.make(KUVA_URL, smCron);
43
- this.#sentientCache = await Cache.make(SENTIENT_URL, smCron);
39
+ this.#wsRawCache = await Cache.make(worldstateUrl, worldstateCron);
40
+ this.#kuvaCache = await Cache.make(kuvaUrl, externalCron);
41
+ this.#sentientCache = await Cache.make(sentientUrl, externalCron);
44
42
 
45
43
  await this.setUpRawEmitters();
46
44
  this.setupParsedEvents();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worldstate-emitter",
3
- "version": "2.2.9",
3
+ "version": "2.2.11",
4
4
  "description": "Event emitter for worldstate & other warframe events",
5
5
  "keywords": [
6
6
  "warframe",
@@ -1,6 +1,9 @@
1
- export const WORLDSTATE_URL = process.env.WORLDSTATE_URL ?? 'https://api.warframe.com/cdn/worldState.php';
2
- export const KUVA_URL = process.env.KUVA_URL ?? 'https://10o.io/arbitrations.json';
3
- export const SENTIENT_URL = process.env.SENTIENT_URL ?? 'https://semlar.com/anomaly.json';
1
+ export const worldstateUrl = process.env.WORLDSTATE_URL ?? 'https://api.warframe.com/cdn/worldState.php';
2
+ export const kuvaUrl = process.env.KUVA_URL ?? 'https://10o.io/arbitrations.json';
3
+ export const sentientUrl = process.env.SENTIENT_URL ?? 'https://semlar.com/anomaly.json';
4
+
5
+ export const worldstateCron = process.env.WORLDSTATE_CRON ?? '25 */5 * * * *';
6
+ export const externalCron = process.env.WS_EXTERNAL_CRON ?? '0 */10 * * * *';
4
7
 
5
8
  export const FEATURES = process.env.WS_EMITTER_FEATURES
6
9
  ? process.env.WS_EMITTER_FEATURES.split(',')
@@ -43,7 +43,7 @@ export default class WSCache {
43
43
  try {
44
44
  deps.kuvaData = JSON.parse(await this.#kuvaCache.get());
45
45
  } catch (err) {
46
- logger.warn(`Error parsing kuva data for ${this.#language}: ${err}`);
46
+ logger.debug(`Error parsing kuva data for ${this.#language}: ${err}`);
47
47
  }
48
48
  try {
49
49
  deps.sentientData = JSON.parse(await this.#sentientCache.get());