mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修复定时任务/视图/环境变量更新逻辑
This commit is contained in:
parent
697bcb5922
commit
e1e6261b4f
|
@ -41,8 +41,9 @@ export default class CronService {
|
|||
}
|
||||
|
||||
public async update(payload: Crontab): Promise<Crontab> {
|
||||
payload.saved = false;
|
||||
const newDoc = await this.updateDb(payload);
|
||||
const tab = new Crontab(payload);
|
||||
tab.saved = false;
|
||||
const newDoc = await this.updateDb(tab);
|
||||
await this.set_crontab();
|
||||
return newDoc;
|
||||
}
|
||||
|
@ -452,7 +453,6 @@ export default class CronService {
|
|||
} else {
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private make_command(tab: Crontab) {
|
||||
|
|
|
@ -31,7 +31,7 @@ export default class CronViewService {
|
|||
}
|
||||
|
||||
public async update(payload: CrontabView): Promise<CrontabView> {
|
||||
const newDoc = await this.updateDb(payload);
|
||||
const newDoc = await this.updateDb(new CrontabView(payload));
|
||||
return newDoc;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ export default class EnvService {
|
|||
}
|
||||
|
||||
public async update(payload: Env): Promise<Env> {
|
||||
const newDoc = await this.updateDb(payload);
|
||||
const newDoc = await this.updateDb(new Env(payload));
|
||||
await this.set_envs();
|
||||
return newDoc;
|
||||
}
|
||||
|
@ -98,7 +98,11 @@ export default class EnvService {
|
|||
|
||||
private async checkPosition(position: number, edge: number = 0) {
|
||||
const precisionPosition = parseFloat(position.toPrecision(16));
|
||||
if (precisionPosition < minPosition || precisionPosition > maxPosition || Math.abs(precisionPosition - edge) < minPosition) {
|
||||
if (
|
||||
precisionPosition < minPosition ||
|
||||
precisionPosition > maxPosition ||
|
||||
Math.abs(precisionPosition - edge) < minPosition
|
||||
) {
|
||||
const envs = await this.envs();
|
||||
let position = initPosition;
|
||||
for (const env of envs) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user