gpt4 book ai didi

java - Quartz : Based on configured schedule, 给定的触发器永远不会触发

转载 作者:行者123 更新时间:2023-12-02 07:40:59 29 4
gpt4 key购买 nike

我在安排作业时收到“根据配置的计划,给定的触发器永远不会触发”错误。我尝试将“.startNow()”添加到触发器中,但这并没有解决问题。我不明白我做错了什么。

JobDetail jobDetail = newJob(DeploymentJob.class)
.withIdentity(scheduleName)
.usingJobData("uploadLocation", deployment.getUploadDir())
.build();

// Add the job to the Scheduler
scheduler.addJob(jobDetail, true);

// Create the trigger with cron expression
Trigger trigger = newTrigger()
.withIdentity(scheduleName)
.withSchedule(cronSchedule(cron))
.forJob(jobDetail)
.build();

// Tell quartz to schedule the job using our trigger
scheduler.scheduleJob(jobDetail, trigger); <--- Problem line.

scheduler.start();

提前感谢您的回答!非常感谢!

最佳答案

你的设置时间超出了。Spring Quartz不会执行超出时间的任务。所以改变你的设置时间。

关于java - Quartz : Based on configured schedule, 给定的触发器永远不会触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11612236/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com