Skip to content

Commit a502b87

Browse files
committed
-
1 parent 660540d commit a502b87

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Diff for: src/problem/problem.service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export class ProblemService {
160160

161161
async get(
162162
id: bigint,
163-
options?: { userId: string },
163+
options: { userId?: string } = {},
164164
): Promise<ProblemService.get.Result> {
165165
const now = new Date();
166166
let problem = await this.problems.findOneOrThrow({
@@ -169,7 +169,7 @@ export class ProblemService {
169169

170170
// Allow admin to get problem before start
171171
if (problem.startTime !== null && problem.startTime > now) {
172-
if (options?.userId === undefined) {
172+
if (options.userId === undefined) {
173173
throw new NotFoundException('problem not found');
174174
}
175175

Diff for: src/submit/submit.service.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { Artifacts } from '../problem/artifacts';
1212
import { ProblemService } from '../problem/problem.service';
1313
import { Language } from '../problem/template';
1414
import { UserRepository } from '../user/user.repository';
15+
import { bigint } from '../util/bigint';
1516
import { tryTypia } from '../util/try-typia';
1617
import { SubmitStatus } from './status';
1718
import { Process, StartProcess, SubmitResult } from './submit-worker.service';
@@ -338,6 +339,7 @@ export class SubmitService {
338339
exchange: 'submitWorker.loadBalancer',
339340
routingKey: 'submitWorker.process',
340341
payload: data satisfies Process.Data,
342+
timeout: 1000 * 60 * 5, // 5 minutes
341343
});
342344
}
343345

0 commit comments

Comments
 (0)