小编T. *_*. Ç的帖子

如何跳过拉取请求的默认管道?

在我目前正在进行的项目中,我想根据以下规则运行bitbucket管道。

  • 应该为推送到分支的每个提交运行测试和 lint 步骤。
  • 必须为使用 Pull 请求打开的每条记录运行测试覆盖率和 lint 步骤。

这里的问题是,如果我将提交推送到已打开拉取请求的分支,则管道会被触发两次。

pipelines:
  default:
    - step: *lint
    - step: *test
  pull-requests:
    '**':
      - step: *lint
      - step: *test-with-coverage
Run Code Online (Sandbox Code Playgroud)

我寻找一种在拉取请求存在时跳过默认管道的方法,但我找不到它。我愿意接受建议和意见。

bitbucket-pipelines bitbucket-cloud

5
推荐指数
1
解决办法
1309
查看次数

Spring Redis 缓存中的 ClassCastException

我正在使用 Spring Boot 版本 2.1.8.RELEASE 开发 Spring Boot 应用程序。我需要构建自定义 RedisCacheManager。

RedisCacheManager如下。

@EnableCaching
@Configuration
class CacheConfig {
    @Bean
    fun redisCacheManager(lettuceConnectionFactory: RedisConnectionFactory): RedisCacheManager? {
        val redisCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig()
            .entryTtl(Duration.ofHours(1))

        return RedisCacheManager.RedisCacheManagerBuilder
            .fromConnectionFactory(lettuceConnectionFactory)
            .cacheDefaults(redisCacheConfiguration)
            .build()
    }
}
Run Code Online (Sandbox Code Playgroud)

在我的服务中,我使用 @Cacheble 缓存响应。看:

@Cacheable(cacheNames = ["cached_sample"])
    fun getAllSample(): List<SampleRecord> {
        return auditableRepository.findAll()
    }
Run Code Online (Sandbox Code Playgroud)

模型我缓存:

data class SampleRecord(
    @ApiModelProperty(readOnly = true)
    val id: Long? = null,
    @ApiModelProperty(readOnly = true)
    val active: Boolean? = null,
    @ApiModelProperty(readOnly = true)
    val createdDate: Instant? = null,
    val param: String
): Serializable …
Run Code Online (Sandbox Code Playgroud)

redis spring-data redis-cache spring-boot spring-cache

3
推荐指数
1
解决办法
3293
查看次数