mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-04-25 23:37:43 -05:00
This should reduce the number of queries needed during high-load times (like waiting for Splatfest results).
53 lines
1.2 KiB
JavaScript
53 lines
1.2 KiB
JavaScript
import GearUpdater from "./updaters/GearUpdater.mjs";
|
|
import StageScheduleUpdater from "./updaters/StageScheduleUpdater.mjs";
|
|
import CoopUpdater from "./updaters/CoopUpdater.mjs";
|
|
import FestivalUpdater from "./updaters/FestivalUpdater.mjs";
|
|
import XRankUpdater from "./updaters/XRankUpdater.mjs";
|
|
import StagesUpdater from "./updaters/StagesUpdater.mjs";
|
|
|
|
function updaters() {
|
|
return [
|
|
new StageScheduleUpdater,
|
|
new GearUpdater,
|
|
new CoopUpdater,
|
|
new FestivalUpdater('US'),
|
|
new FestivalUpdater('EU'),
|
|
new FestivalUpdater('JP'),
|
|
new FestivalUpdater('AP'),
|
|
new StagesUpdater,
|
|
new XRankUpdater('Tentatek', 'ATLANTIC'),
|
|
new XRankUpdater('Takoroka', 'PACIFIC'),
|
|
];
|
|
}
|
|
|
|
const configs = {
|
|
quick: {
|
|
disableLocalizations: true,
|
|
disableXRank: true,
|
|
disableFestivalDetails: true,
|
|
},
|
|
default: {
|
|
disableXRank: true,
|
|
},
|
|
all: {
|
|
// Everything enabled
|
|
},
|
|
};
|
|
|
|
export async function update(config = 'default') {
|
|
console.info(`Running ${config} updaters...`);
|
|
|
|
let settings = configs[config];
|
|
|
|
for (let updater of updaters()) {
|
|
updater.settings = settings;
|
|
try {
|
|
await updater.updateIfNeeded();
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
}
|
|
|
|
console.info(`Done running ${config} updaters`);
|
|
}
|