mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-02 20:28:03 +08:00
[Fix-7070][UI] Remedy the issue with no saving the timeout's strategy into the database. (#7107)
This commit is contained in:
parent
173a385618
commit
d7eb7453e5
@ -33,6 +33,7 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -158,6 +159,7 @@ public class TaskDefinition {
|
||||
/**
|
||||
* timeout notify strategy
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private TaskTimeoutStrategy timeoutNotifyStrategy;
|
||||
|
||||
/**
|
||||
|
@ -60,7 +60,11 @@
|
||||
<script>
|
||||
import _ from 'lodash'
|
||||
import disabledState from '@/module/mixin/disabledState'
|
||||
|
||||
const StrategyMap = {
|
||||
WARN: 'WARN',
|
||||
FAILED: 'FAILED',
|
||||
WARNFAILED: 'WARNFAILED'
|
||||
}
|
||||
export default {
|
||||
name: 'form-timeout-alarm',
|
||||
data () {
|
||||
@ -100,10 +104,12 @@
|
||||
strategy: (() => {
|
||||
// Handling checkout sequence
|
||||
let strategy = this.strategy
|
||||
if (strategy.length === 2 && strategy[0] === 'FAILED') {
|
||||
return [strategy[1], strategy[0]].join(',')
|
||||
if (strategy.length > 1) {
|
||||
return StrategyMap.WARNFAILED
|
||||
} else if (strategy.length === 1) {
|
||||
return strategy[0]
|
||||
} else {
|
||||
return strategy.join(',')
|
||||
return ''
|
||||
}
|
||||
})(),
|
||||
interval: parseInt(this.interval),
|
||||
@ -119,7 +125,15 @@
|
||||
// Non-null objects represent backfill
|
||||
if (!_.isEmpty(o) && o.timeout) {
|
||||
this.enable = o.timeout.enable || false
|
||||
this.strategy = _.split(o.timeout.strategy, ',') || ['WARN']
|
||||
if (o.timeout.strategy) {
|
||||
if (o.timeout.strategy === StrategyMap.WARNFAILED) {
|
||||
this.strategy = [StrategyMap.WARN, StrategyMap.FAILED]
|
||||
} else {
|
||||
this.strategy = [o.timeout.strategy]
|
||||
}
|
||||
} else {
|
||||
this.strategy = [StrategyMap.WARN]
|
||||
}
|
||||
this.interval = o.timeout.interval || null
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user