style(api): apply prettier formatting
This commit is contained in:
1 parent
80fef25af3
commit
96fede9fe5
75 files changed
+955
-674
No files matched your search
@@ -95,7 +95,8 @@ export class RiotJobQueueService {
|
||||
jobId: existingJobId,
|
||||
queueGroup,
|
||||
alreadyQueued: true,
|
||||
etaSeconds: existingStatus?.etaSeconds ?? queuePosition * RIOT_JOB_AVG_SECONDS,
|
||||
etaSeconds:
|
||||
existingStatus?.etaSeconds ?? queuePosition * RIOT_JOB_AVG_SECONDS,
|
||||
queuePosition: existingStatus?.queuePosition ?? queuePosition,
|
||||
});
|
||||
continue;
|
||||
@@ -127,7 +128,8 @@ export class RiotJobQueueService {
|
||||
jobId,
|
||||
queueGroup,
|
||||
alreadyQueued: true,
|
||||
etaSeconds: status?.etaSeconds ?? queuePosition * RIOT_JOB_AVG_SECONDS,
|
||||
etaSeconds:
|
||||
status?.etaSeconds ?? queuePosition * RIOT_JOB_AVG_SECONDS,
|
||||
queuePosition: status?.queuePosition ?? queuePosition,
|
||||
});
|
||||
continue;
|
||||
@@ -164,7 +166,10 @@ export class RiotJobQueueService {
|
||||
});
|
||||
}
|
||||
|
||||
await this.setParent(parentJobId, subJobs.map((job) => job.jobId));
|
||||
await this.setParent(
|
||||
parentJobId,
|
||||
subJobs.map((job) => job.jobId),
|
||||
);
|
||||
if (params.priority === 'high' && needsNewJob) {
|
||||
await this.markRefreshRequested(context.user._id, context.account.puuid);
|
||||
}
|
||||
@@ -253,8 +258,8 @@ export class RiotJobQueueService {
|
||||
const subJobs = (
|
||||
await Promise.all(jobIds.map((jobId) => this.getStatus(jobId)))
|
||||
).filter((status): status is RiotJobStatus => Boolean(status));
|
||||
const done = subJobs.filter((job) =>
|
||||
job.state === 'completed' || job.state === 'failed',
|
||||
const done = subJobs.filter(
|
||||
(job) => job.state === 'completed' || job.state === 'failed',
|
||||
).length;
|
||||
const state = this.resolveParentState(subJobs);
|
||||
|
||||
@@ -411,12 +416,14 @@ export class RiotJobQueueService {
|
||||
job: PollTournamentResultJob,
|
||||
deferUntilMs: number,
|
||||
): Promise<void> {
|
||||
await this.redisService.raw().sendCommand([
|
||||
'ZADD',
|
||||
RIOT_JOB_SCHEDULED_ZSET,
|
||||
String(deferUntilMs),
|
||||
JSON.stringify(job),
|
||||
]);
|
||||
await this.redisService
|
||||
.raw()
|
||||
.sendCommand([
|
||||
'ZADD',
|
||||
RIOT_JOB_SCHEDULED_ZSET,
|
||||
String(deferUntilMs),
|
||||
JSON.stringify(job),
|
||||
]);
|
||||
}
|
||||
|
||||
private parseScheduledJob(value: string): PollTournamentResultJob | null {
|
||||
@@ -449,7 +456,10 @@ export class RiotJobQueueService {
|
||||
);
|
||||
}
|
||||
|
||||
private async setParent(parentJobId: string, jobIds: string[]): Promise<void> {
|
||||
private async setParent(
|
||||
parentJobId: string,
|
||||
jobIds: string[],
|
||||
): Promise<void> {
|
||||
await this.redisService.setJson(
|
||||
this.parentKey(parentJobId),
|
||||
jobIds,
|
||||
|
||||
Reference in new issue
Block a user