bump beta.10

This commit is contained in:
undefined committed 2025-10-19 20:13:27 +08:00
1 parent e33575343c
commit a8246eacd6
27 files changed
+143 -112

No files matched your search

+3 -3
View File
@@ -59,7 +59,9 @@ class ScheduleModel {
}
export async function apply(ctx: Context) {
ctx.inject(['worker'], (c) => {
ctx.on('domain/delete', (domainId) => coll.deleteMany({ domainId }));
await ctx.inject(['worker'], (c) => {
c.worker.addHandler('task.daily', async (task) => {
const pref: Record<string, number> = {};
let start = Date.now();
@@ -88,8 +90,6 @@ export async function apply(ctx: Context) {
});
});
ctx.on('domain/delete', (domainId) => coll.deleteMany({ domainId }));
if (process.env.NODE_APP_INSTANCE !== '0') return;
if (!await ScheduleModel.count({ type: 'schedule', subType: 'task.daily' })) {
await ScheduleModel.add({
+3 -3
View File
@@ -179,9 +179,6 @@ async function cleanFiles() {
}
export async function apply(ctx: Context) {
ctx.inject(['worker'], (c) => {
c.worker.addHandler('storage.prune', cleanFiles);
});
ctx.on('domain/delete', async (domainId) => {
const [problemFiles, contestFiles, trainingFiles] = await Promise.all([
StorageModel.list(`problem/${domainId}`),
@@ -190,6 +187,9 @@ export async function apply(ctx: Context) {
]);
await StorageModel.del(problemFiles.concat(contestFiles).concat(trainingFiles).map((i) => i.path));
});
await ctx.inject(['worker'], (c) => {
c.worker.addHandler('storage.prune', cleanFiles);
});
if (process.env.NODE_APP_INSTANCE !== '0') return;
await db.ensureIndexes(
StorageModel.coll,