MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / apply

Function apply

packages/hydrooj/src/script/problemStat.ts:167–187  ·  view source on GitHub ↗
(ctx)

Source from the content-addressed store, hash-verified

165}
166
167export const apply = (ctx) => ctx.addScript(
168 'problemStat', 'Recalculates nSubmit and nAccept in problem status.',
169 Schema.object({
170 udoc: Schema.boolean(),
171 pdoc: Schema.boolean(),
172 psdoc: Schema.boolean(),
173 }),
174 async (arg, report) => {
175 if (arg.pdoc === undefined || arg.pdoc) {
176 const start = Date.now();
177 await pdoc(report);
178 report({ message: `pdoc finished in ${Date.now() - start}ms` });
179 }
180 if (arg.udoc === undefined || arg.udoc) {
181 const start = Date.now();
182 await udoc(report);
183 report({ message: `udoc finished in ${Date.now() - start}ms` });
184 }
185 return true;
186 },
187);

Callers

nothing calls this directly

Calls 3

pdocFunction · 0.85
reportFunction · 0.85
udocFunction · 0.85

Tested by

no test coverage detected