-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig.js
More file actions
49 lines (45 loc) · 1.43 KB
/
config.js
File metadata and controls
49 lines (45 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const path = require("path");
const { UserThrottlingPolicy } = require("@routes/policies");
const { SharedConfig } = require("~/config.shared");
export const JudgeConfig = {
MAX_TRIES: 5,
EPS: 1e-7,
SANDBOX_OFFSET: parseInt(process.env.SANDBOX_OFFSET || 0, 10),
MAX_SANDBOXES: parseInt(process.env.MAX_SANDBOXES || 10, 10),
MAX_SIMUL_TESTS: parseInt(process.env.MAX_SIMUL_TESTS || 1, 10),
COMPILATION_TL: 90,
CHECKING_TL: 90,
CHECKING_ML: 512,
CHECKING_WTL: 90,
WT_MULTIPLIER: 15,
OUTPUT_LIMIT: 1 << 24,
TEMP_DIR: "/tmp",
ISOLATE_PATH: path.resolve("/usr/local/bin/isolate"),
VISIBILITY_WINDOW: parseInt(process.env.VISIBILITY_WINDOW || 20, 10),
BOUND_ML: 2048
};
export const SiteConfig = {
...SharedConfig,
// throttling
throttling: {
submissions: new UserThrottlingPolicy([
{ windowMs: 10 * 1000, max: 3 },
{ windowMs: 60 * 1000, max: 7 },
{ windowMs: 2 * 60 * 1000, max: 10 }
], {
message: "You submitted too many times! Wait until you can submit again."
}),
clarifications: new UserThrottlingPolicy([
{ windowMs: 60 * 1000, max: 4 },
{ windowMs: 10 * 60 * 1000, max: 10 }
], {
message: "You can't spam clarifications like that!"
}),
printouts: new UserThrottlingPolicy([
{ windowMs: 60 * 1000, max: 4 },
{ windowMs: 10 * 60 * 1000, max: 10 }
], {
message: "You can't ask for printouts like that! Wait and try again."
})
}
};