使用传统的运行 mongock 的方法 - https://www.mongock.io/quick-start#traditional-builder-approach
@Bean
public MongockSpring5.MongockInitializingBeanRunner changockSpring5(ApplicationContext springContext, MongoClient mongoClient) {
SpringDataMongoV3Driver driver = SpringDataMongoV3Driver.withDefaultLock(
new MongoTemplate(mongoClient, database));
return MongockSpring5
.builder()
.setDriver(driver)
.addChangeLogsScanPackage("com.abc.mongock.migration")
.setSpringContext(springContext)
.buildInitializingBeanRunner();
}
我们如何将配置传递给此构建器以将“throwExceptionIfCannotObtainLock”设置为 false?