Skip to content

Commit

Permalink
perf:misc多线程清理构建数据优化 TencentBlueKing#4645
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Jul 9, 2021
1 parent 9eb24b6 commit 453901d
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import java.util.concurrent.Executors
import java.util.concurrent.Future
import java.util.concurrent.LinkedBlockingQueue
import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.ThreadPoolExecutor.AbortPolicy
import java.util.concurrent.TimeUnit

@Component
Expand Down Expand Up @@ -136,7 +135,7 @@ class PipelineBuildHistoryDataClearJob @Autowired constructor(
} else {
index * avgProjectNum + maxProjectNum % maxThreadHandleProjectNum
}
// 判断线程是否正在处理任务,如果正在处理任务则不分配新任务
// 判断线程是否正在处理任务,如正在处理则不分配新任务(定时任务12秒执行一次,线程启动到往set集合设置编号耗费时间很短,故不加锁)
if (!redisOperation.isMember(PIPELINE_BUILD_HISTORY_DATA_CLEAR_THREAD_SET_KEY, index.toString())) {
doClearBus(
threadNo = index,
Expand Down

0 comments on commit 453901d

Please sign in to comment.