set default log expire time to 1 day

This commit is contained in:
marvzhang
2020-06-07 21:29:28 +08:00
parent cb067f53c7
commit 144769d86e
3 changed files with 6 additions and 3 deletions

View File

@@ -213,8 +213,8 @@ func SetLogConfig(wg *sync.WaitGroup, cmd *exec.Cmd, t model.Task, u model.User)
// expire duration (in seconds)
expireDuration := u.Setting.LogExpireDuration
if expireDuration == 0 {
// by default not expire
expireDuration = constants.Infinite
// by default 1 day
expireDuration = 3600 * 24
}
// read stdout

View File

@@ -91,6 +91,9 @@ const user = {
if (!response.data.data.setting.max_error_log) {
response.data.data.setting.max_error_log = 1000
}
if (!response.data.data.setting.log_expire_duration) {
response.data.data.setting.log_expire_duration = 3600 * 24
}
commit('SET_USER_INFO', response.data.data)
window.localStorage.setItem('user_info', JSON.stringify(response.data.data))
})

View File

@@ -146,7 +146,7 @@
v-model="userInfo.setting.log_expire_duration"
clearable
>
<el-option :value="0" :label="$t('No Expire')"/>
<el-option :value="99999999" :label="$t('No Expire')"/>
<el-option :value="3600" :label="'1 ' + $t('Hour')"/>
<el-option :value="3600 * 6" :label="'6 ' + $t('Hours')"/>
<el-option :value="3600 * 12" :label="'12 ' + $t('Hours')"/>