Spring Boot 使用deleteonsuccess/failure值配置Jobrunr

kkbh8khc  于 2023-10-16  发布在  Spring
关注(0)|答案(1)|浏览(86)

嗨,我正在尝试配置Jobrunr代码,特别是自定义删除策略:[https://www.jobrunr.io/en/documentation/pro/custom-delete-policy/][1]
我正在尝试一种方法来配置基于www.example.com值的成功和失败的删除application.properties。但由于某种原因,它不允许我这样做,它显示无法解析提供的值。下面的代码片段的工作。

@Recurring(id = "some-id-job", cron = "${some_crontab}")
@Job(name = "some-job", deleteOnFailure = "${jobrunr.cleanup.failedJobsDuration}",
        deleteOnSuccess = "${jobrunr.cleanup.succeededJobsDuration}")
@Transactional
public void initiateAutoSyncPayment(){
    log.debug("Initiating Job.....");
    someJob = jobService.enqueueAutoSyncPayment(company.getCompanyId()));
}

应用程序属性片段

jobrunr.cleanup.succeededJobsDuration=P1D! -- delete after one day.
jobrunr.cleanup.failedJobsDuration=P7D!    -- delete after seven days
e3bfsja2

e3bfsja21#

这是唯一可用的付费专业版,我很抱歉.😬

相关问题