22 lines
681 B
TypeScript
22 lines
681 B
TypeScript
import 'dotenv/config';
|
|
import { runDeviationHeatmapJob } from './deviationHeatmapJob.js';
|
|
|
|
const [, , a, b, c] = process.argv;
|
|
const resultId = Number(a);
|
|
const taskId = Number(b);
|
|
const totalPoints = Number(c);
|
|
|
|
if (!Number.isFinite(resultId) || !Number.isFinite(taskId) || resultId <= 0 || taskId <= 0) {
|
|
console.error('[DeviationHeatmapJobRunner] 用法: <resultId> <taskId> <totalPoints>');
|
|
process.exit(1);
|
|
}
|
|
|
|
const pts = Number.isFinite(totalPoints) && totalPoints > 0 ? totalPoints : 400_000;
|
|
|
|
runDeviationHeatmapJob(resultId, taskId, pts)
|
|
.then(() => process.exit(0))
|
|
.catch((e) => {
|
|
console.error('[DeviationHeatmapJobRunner]', e);
|
|
process.exit(1);
|
|
});
|