Skip to content

Commit

Permalink
feat: nodeUpdateAccessDateEventConsumer迁移到common-metadata #2879
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoxuwan authored Jan 1, 2025
1 parent 6d0846e commit b3334da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ import com.tencent.bkrepo.auth.api.ServicePermissionClient
import com.tencent.bkrepo.auth.api.ServiceUserClient
import com.tencent.bkrepo.common.api.pojo.ClusterArchitecture
import com.tencent.bkrepo.common.api.pojo.ClusterNodeType
import com.tencent.bkrepo.common.artifact.event.base.ArtifactEvent
import com.tencent.bkrepo.common.artifact.properties.ArtifactEventProperties
import com.tencent.bkrepo.common.artifact.properties.RouterControllerProperties
import com.tencent.bkrepo.common.metadata.condition.SyncCondition
import com.tencent.bkrepo.common.metadata.config.RepositoryProperties
import com.tencent.bkrepo.common.metadata.listener.NodeUpdateAccessDateEventListener
import com.tencent.bkrepo.common.metadata.permission.EdgePermissionManager
import com.tencent.bkrepo.common.metadata.permission.PermissionManager
import com.tencent.bkrepo.common.metadata.permission.ProxyPermissionManager
Expand All @@ -55,6 +57,8 @@ import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Conditional
import org.springframework.context.annotation.Configuration
import org.springframework.messaging.Message
import java.util.function.Consumer

@Configuration
@ConditionalOnWebApplication
Expand Down Expand Up @@ -136,4 +140,14 @@ class MetadataAutoConfiguration {
principalManager = principalManager
)
}

// 之前继承Consumer方式框架升级后会报错,https://github.com/spring-cloud/spring-cloud-stream/issues/2704
@Bean("nodeUpdateAccessDate")
fun nodeUpdateAccessDateEventConsumer(
nodeUpdateAccessDateEventListener: NodeUpdateAccessDateEventListener
): Consumer<Message<ArtifactEvent>> {
return Consumer {
nodeUpdateAccessDateEventListener.accept(it)
}
}
}

This file was deleted.

0 comments on commit b3334da

Please sign in to comment.