refactor: 修改定时任务间隔校验

This commit is contained in:
chenjianxing 2020-07-21 22:20:46 +08:00
parent 73774dae50
commit 751df79f2d
4 changed files with 12 additions and 8 deletions

View File

@ -51,9 +51,11 @@
callback(new Error(this.$t('commons.input_content')));
} else if (!cronValidate(cronValue)) {
callback(new Error(this.$t('schedule.cron_expression_format_error')));
} else if(!this.intervalShortValidate()) {
callback(new Error(this.$t('schedule.cron_expression_interval_short_error')));
} else if (!customValidate.pass){
}
// else if(!this.intervalShortValidate()) {
// callback(new Error(this.$t('schedule.cron_expression_interval_short_error')));
// }
else if (!customValidate.pass){
callback(new Error(customValidate.info));
} else {
callback();
@ -87,6 +89,7 @@
saveCron () {
this.$refs['from'].validate((valid) => {
if (valid) {
this.intervalShortValidate();
this.save(this.form.cronValue);
this.dialogVisible = false;
} else {
@ -103,8 +106,9 @@
}
},
intervalShortValidate() {
if (this.getIntervalTime() < 5*60*1000) {
return false;
if (this.getIntervalTime() < 3*60*1000) {
// return false;
this.$info(this.$t('schedule.cron_expression_interval_short_error'));
}
return true;
},

View File

@ -685,7 +685,7 @@ export default {
please_input_cron_expression: "Please Input Cron Expression",
generate_expression: "Generate Expression",
cron_expression_format_error: "Cron Expression Format Error",
cron_expression_interval_short_error: "Interval Time Should Longer than 5 Minutes",
cron_expression_interval_short_error: "Interval time shorter than 3 minutes, please avoid running tests that take too long",
cron: {
seconds: "Seconds",
minutes: "Minutes",

View File

@ -684,7 +684,7 @@ export default {
please_input_cron_expression: "请输入 Cron 表达式",
generate_expression: "生成表达式",
cron_expression_format_error: "Cron 表达式格式错误",
cron_expression_interval_short_error: "间隔时间请大于 5 分钟",
cron_expression_interval_short_error: "间隔时间小于 3 分钟, 请避免执行耗时过长的测试",
cron: {
seconds: "秒",
minutes: "分钟",

View File

@ -683,7 +683,7 @@ export default {
please_input_cron_expression: "請輸入 Cron 表達式",
generate_expression: "生成表達式",
cron_expression_format_error: "Cron 表達式格式錯誤",
cron_expression_interval_short_error: "間隔時間請大於 5 分鐘",
cron_expression_interval_short_error: "間隔時間小於 3 分鐘, 請避免執行耗時過長的測試",
cron: {
seconds: "秒",
minutes: "分鐘",