core: seperate task and schedule to enhance performance (#440)

This commit is contained in:
undefined authored and GitHub committed 2022-10-16 01:13:21 +08:00
1 parent 101fcaa1b5
commit 175609259a
19 files changed
+250 -144

No files matched your search

+2 -2
View File
@@ -16,9 +16,9 @@ import domain from '../model/domain';
import oauth from '../model/oauth';
import * as oplog from '../model/oplog';
import problem, { ProblemDoc } from '../model/problem';
import ScheduleModel from '../model/schedule';
import SolutionModel from '../model/solution';
import * as system from '../model/system';
import task from '../model/task';
import token from '../model/token';
import user from '../model/user';
import {
@@ -376,7 +376,7 @@ class UserDetailHandler extends Handler {
class UserDeleteHandler extends Handler {
async post({ password }) {
this.user.checkPassword(password);
const tid = await task.add({
const tid = await ScheduleModel.add({
executeAfter: moment().add(7, 'days').toDate(),
type: 'script',
id: 'deleteUser',