Skip to content

Commit

Permalink
perf: Job 切换 GSE2.0 支持灰度策略 TencentBlueKing#2461
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyu096 committed Oct 7, 2023
1 parent f4985e1 commit 50c12f6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Tencent is pleased to support the open source community by making BK-JOB蓝鲸智云作业平台 available.
*
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
*
* BK-JOB蓝鲸智云作业平台 is licensed under the MIT License.
*
* License for BK-JOB蓝鲸智云作业平台:
* --------------------------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/

package com.tencent.bk.job.common.service;

import com.tencent.bk.job.common.util.feature.FeatureStore;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
public class CommonServiceAutoConfiguration {

@Bean
public ConfigRefreshEventListener configRefreshEventListener(FeatureStore featureStore) {
return new ConfigRefreshEventListener(featureStore);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,20 @@
import com.tencent.bk.job.common.util.feature.FeatureStore;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.environment.EnvironmentChangeEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

import java.util.Set;
import java.util.StringJoiner;

/**
* 配置刷新监听
*/
@Component
@Slf4j
public class ConfigRefreshEventListener {

private final FeatureStore featureStore;

@Autowired
public ConfigRefreshEventListener(FeatureStore featureStore) {
this.featureStore = featureStore;
log.info("Init ConfigRefreshEventListener");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.tencent.bk.job.common.service.lb.JobLoadBalancerClientAutoConfiguration, \
com.tencent.bk.job.common.service.deploy.DeployAutoConfiguration, \
com.tencent.bk.job.common.service.feature.FeatureToggleAutoConfiguration
com.tencent.bk.job.common.service.feature.FeatureToggleAutoConfiguration, \
com.tencent.bk.job.common.service.CommonServiceAutoConfiguration

0 comments on commit 50c12f6

Please sign in to comment.