Repair the conflict

pull/289/head
lucky 8 2 years ago
commit 9ff52556c4

@ -0,0 +1,169 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Continuous Integration
on:
push:
branches: [ develop ]
paths:
- '.github/workflows/ci.yml'
- '**/pom.xml'
- '**/src/main/**'
- '**/src/test/**'
- '!*.md'
pull_request:
branches: [ master ]
paths:
- '.github/workflows/ci.yml'
- '**/pom.xml'
- '**/src/main/**'
- '**/src/test/**'
- '!*.md'
repository_dispatch:
types: [rerun-ci]
schedule:
- cron: '0 16 */1 * *' # once a day. UTC time
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
windows:
if: (github.event_name == 'schedule' && github.repository == 'mabaiwan/hippo4j')
runs-on: windows-latest
timeout-minutes: 60
steps:
- name: Cache Maven Repos
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Support longpaths
run: git config --system core.longpaths true
- uses: actions/checkout@v2
- name: Dump concurrency group
env:
CON_GROUP: ${{ github.workflow }}-${{ github.ref }}
run: echo "$CON_GROUP"
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 8
- name: Build with Maven
shell: cmd
run: |
.\mvnw -B --no-transfer-progress clean -D"spotless.apply.skip"=true install < nul
echo "mvnw exited"
ubuntu:
if: (github.event_name == 'schedule' && github.repository == 'mabaiwan/hippo4j')
name: JDK 8 - on ubuntu-latest
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- name: Maven resolve ranges
run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
- name: Cache Maven Repos
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 8
- name: Build with Maven
run: echo y | ./mvnw -B --no-transfer-progress clean install -Dcheckstyle.skip=true -Dspotless.apply.skip=true
unix:
if: (github.event_name == 'schedule' && github.repository == 'mabaiwan/hippo4j') || (github.event_name != 'schedule')
name: JDK ${{ matrix.java.version }} - on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
os: [ ubuntu-latest ]
java:
- {
version: 11,
maven_args: "-Dspotless.apply.skip=true"
}
- {
version: 17,
maven_args: "-Dspotless.apply.skip=true"
}
steps:
- uses: actions/checkout@v2
- name: Maven resolve ranges
run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
- name: Cache Maven Repos
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK ${{ matrix.java.version }}
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: ${{ matrix.java.version }}
- name: Build with Maven
run: echo y | ./mvnw -B --no-transfer-progress clean install ${{ matrix.java.maven_args }}
macos:
if: (github.event_name == 'schedule' && github.repository == 'mabaiwan/hippo4j')
name: macos
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
os: [ macos-latest ]
java:
- {
version: 8,
maven_args: "-Dspotless.apply.skip=true"
}
steps:
- name: Cache Maven Repos
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java.version }}
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: ${{ matrix.java.version }}
- name: Build with Maven
run: echo y | ./mvnw -B --no-transfer-progress clean install ${{ matrix.java.maven_args }}

@ -30,5 +30,4 @@ public class ThreadPoolAdapterScheduleAutoConfiguration {
public ThreadPoolAdapterScheduler threadPoolAdapterExtra() {
return new ThreadPoolAdapterScheduler();
}
}

@ -19,6 +19,7 @@ package cn.hippo4j.adapter.base;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;

@ -52,9 +52,7 @@ public class HystrixThreadPoolAdapter implements ThreadPoolAdapter, ApplicationL
private ThreadPoolAdapterScheduler threadPoolAdapterScheduler;
public HystrixThreadPoolAdapter(ThreadPoolAdapterScheduler threadPoolAdapterScheduler) {
this.threadPoolAdapterScheduler = threadPoolAdapterScheduler;
}
@Override
@ -146,7 +144,6 @@ public class HystrixThreadPoolAdapter implements ThreadPoolAdapter, ApplicationL
} catch (Exception e) {
log.error("Failed to get Hystrix thread pool.", e);
}
}
class HystrixThreadPoolRefreshTask implements Runnable {

@ -134,11 +134,8 @@ public class ThreadPoolAdapterRegister implements ApplicationRunner, ThreadPoolA
public void run() {
try {
List<ThreadPoolAdapterCacheConfig> newThreadPoolAdapterCacheConfigs = getThreadPoolAdapterCacheConfigs(threadPoolAdapterMap);
boolean registerFlag = compareThreadPoolAdapterCacheConfigs(newThreadPoolAdapterCacheConfigs, cacheConfigList);
cacheConfigList = newThreadPoolAdapterCacheConfigs;
if (registerFlag) {
doRegister(cacheConfigList);
}
@ -155,15 +152,12 @@ public class ThreadPoolAdapterRegister implements ApplicationRunner, ThreadPoolA
private boolean compareThreadPoolAdapterCacheConfigs(List<ThreadPoolAdapterCacheConfig> newThreadPoolAdapterCacheConfigs,
List<ThreadPoolAdapterCacheConfig> oldThreadPoolAdapterCacheConfigs) {
boolean registerFlag = false;
Map<String, List<ThreadPoolAdapterState>> newThreadPoolAdapterCacheConfigMap =
newThreadPoolAdapterCacheConfigs.stream().collect(Collectors.toMap(
ThreadPoolAdapterCacheConfig::getMark, ThreadPoolAdapterCacheConfig::getThreadPoolAdapterStates, (k1, k2) -> k2));
Map<String, List<ThreadPoolAdapterState>> oldThreadPoolAdapterCacheConfigMap =
oldThreadPoolAdapterCacheConfigs.stream().collect(Collectors.toMap(
ThreadPoolAdapterCacheConfig::getMark, ThreadPoolAdapterCacheConfig::getThreadPoolAdapterStates, (k1, k2) -> k2));
for (Map.Entry<String, List<ThreadPoolAdapterState>> entry : newThreadPoolAdapterCacheConfigMap.entrySet()) {
String key = entry.getKey();
List<ThreadPoolAdapterState> newValue = entry.getValue();

Loading…
Cancel
Save