mirror of
https://github.com/whyour/qinglong.git
synced 2025-12-23 15:50:07 +08:00
Optimize memory usage by fetching only required fields
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
8ae7a85bf8
commit
c32a53c40b
|
|
@ -133,7 +133,10 @@ export default async () => {
|
||||||
|
|
||||||
// 初始化更新所有任务状态为空闲
|
// 初始化更新所有任务状态为空闲
|
||||||
// 但保留仍在运行的任务的状态
|
// 但保留仍在运行的任务的状态
|
||||||
const allCrons = await CrontabModel.findAll({ raw: true });
|
const allCrons = await CrontabModel.findAll({
|
||||||
|
attributes: ['id', 'pid'],
|
||||||
|
raw: true,
|
||||||
|
});
|
||||||
const idsToReset: number[] = [];
|
const idsToReset: number[] = [];
|
||||||
|
|
||||||
for (const cron of allCrons) {
|
for (const cron of allCrons) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user