mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-09-11 01:55:24 -05:00
Move X-Rank updaters into a separate, low-priority schedule
This commit is contained in:
@@ -16,21 +16,43 @@ function updaters() {
|
||||
tokens.EU && new FestivalUpdater('EU'),
|
||||
tokens.JP && new FestivalUpdater('JP'),
|
||||
tokens.AP && new FestivalUpdater('AP'),
|
||||
new XRankUpdater('Tentatek', 'ATLANTIC'),
|
||||
new XRankUpdater('Takoroka', 'PACIFIC'),
|
||||
].filter(u => u);
|
||||
}
|
||||
|
||||
export async function updateAll() {
|
||||
console.info('Running all updaters...');
|
||||
function lowPriorityUpdaters() {
|
||||
return [
|
||||
new XRankUpdater('Tentatek', 'ATLANTIC'),
|
||||
new XRankUpdater('Takoroka', 'PACIFIC'),
|
||||
];
|
||||
}
|
||||
|
||||
for (let updater of updaters()) {
|
||||
async function run(updaters) {
|
||||
for (let updater of updaters) {
|
||||
try {
|
||||
await updater.updateIfNeeded();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
console.info('Done running updaters');
|
||||
}
|
||||
|
||||
export async function updateAll() {
|
||||
console.info('Running all updaters...');
|
||||
await run([
|
||||
...updaters(),
|
||||
...lowPriorityUpdaters(),
|
||||
]);
|
||||
console.info('Done running all updaters');
|
||||
}
|
||||
|
||||
export async function updatePrimary() {
|
||||
console.info('Running primary updaters...');
|
||||
await run(updaters());
|
||||
console.info('Done running primary updaters');
|
||||
}
|
||||
|
||||
export async function updateLowPriority() {
|
||||
console.info('Running low-priority updaters...');
|
||||
await run(lowPriorityUpdaters());
|
||||
console.info('Done running low-priority updaters');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user