Skip to content

Commit

Permalink
feat:流水线并发运行时,支持限制并发个数和排队 TencentBlueKing#10718
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 18270
  • Loading branch information
vhwweng committed Sep 12, 2024
1 parent 9a2e179 commit ef15ebb
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,50 @@
</div>
</bk-radio-group>
</bk-form-item>
<div class="single-lock-sub-form" v-if="isSingleLock">
<div
v-if="isMultipleLock"
class="single-lock-sub-form"
:key="pipelineSetting.runLockType"
>
<bk-form-item
:required="isMultipleLock"
:label="$t('settings.concurrentMaxConcurrency')"
error-display-type="normal"
property="maxConRunningQueueSize"
>
<bk-input
type="number"
:disabled="!editable"
:placeholder="$t('settings.itemPlaceholder')"
v-model="pipelineSetting.maxConRunningQueueSize"
@change="val => handleBaseInfoChange('maxConRunningQueueSize', val)"
/>
</bk-form-item>

<bk-form-item
:required="isMultipleLock"
:label="$t('settings.concurrentTimeout')"
error-display-type="normal"
property="waitQueueTimeMinute"
>
<bk-input
type="number"
:disabled="!editable"
:placeholder="$t('settings.itemPlaceholder')"
v-model="pipelineSetting.waitQueueTimeMinute"
@change="val => handleBaseInfoChange('waitQueueTimeMinute', val)"
>
<template slot="append">
<span class="pipeline-setting-unit">{{$t('settings.minutes')}}</span>
</template>
</bk-input>
</bk-form-item>
</div>
<div
v-if="isSingleLock"
class="single-lock-sub-form"
:key="isSingleLock"
>
<bk-form-item
:required="isSingleLock"
property="concurrencyGroup"
Expand Down Expand Up @@ -159,6 +202,9 @@
isSingleLock () {
return [this.runTypeMap.GROUP, this.runTypeMap.SINGLE].includes(this.pipelineSetting?.runLockType)
},
isMultipleLock () {
return [this.runTypeMap.MULTIPLE].includes(this.pipelineSetting?.runLockType)
},
formRule () {
const requiredRule = {
required: this.isSingleLock,
Expand All @@ -185,9 +231,25 @@
{
validator: (val) => {
const intVal = parseInt(val, 10)
return !this.isSingleLock || (intVal <= 1440 && intVal >= 1)
if (this.isSingleLock || this.isMultipleLock) {
return intVal <= 1440 && intVal >= 1
}
return true
},
message: `${this.isSingleLock
? this.$t('settings.lagestTime')
: this.$t('settings.concurrentTimeout')
}${this.$t('numberRange', [1, 1440])}`,
trigger: 'blur'
}
],
maxConRunningQueueSize: [
requiredRule,
{
validator: (val) => {
return /^(?:[1-9]|[1-9][0-9]|1[0-9]{2}|200)$/.test(val)
},
message: `${this.$t('settings.lagestTime')}${this.$t('numberRange', [1, 1440])}`,
message: this.$t('settings.maxConRunningQueueSizeTips'),
trigger: 'blur'
}
]
Expand Down
5 changes: 4 additions & 1 deletion src/frontend/locale/pipeline/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,10 @@
"mdLink": "Markdown Link",
"conCopySuc": "Copied Succeed",
"additionDesc": "Description",
"voice": "Voice"
"voice": "Voice",
"concurrentMaxConcurrency": "Maximum Concurrency",
"concurrentTimeout": "Queue Timeout for Exceeding Limit",
"maxConRunningQueueSizeTips": "The range of maximum concurrency is between 1 and 200-200之间"
},
"template": {
"addTemplate": "New Template",
Expand Down
5 changes: 4 additions & 1 deletion src/frontend/locale/pipeline/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,10 @@
"mdLink": "markdown链接",
"conCopySuc": "内容复制成功",
"additionDesc": "其他描述",
"voice": "语音"
"voice": "语音",
"concurrentMaxConcurrency": "最大可并发数",
"concurrentTimeout": "超限时排队,排队超时时间",
"maxConRunningQueueSizeTips": "最大可并发数范围在1-200之间"
},
"template": {
"addTemplate": "新建模板",
Expand Down

0 comments on commit ef15ebb

Please sign in to comment.