java 如何禁用 Quartz 更新尝试?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14147564/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 15:14:48  来源:igfitidea点击:

How to disable Quartz update attempt?

javaquartz-scheduler

提问by James Raitsev

I am using:

我在用:

    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
        <version>1.8.0</version>
    </dependency>

When application comes up, I consistently get:

当应用程序出现时,我一直得到:

2013-01-03 15:25:34 UpdateChecker [DEBUG] Checking for available updated 
                        version of Quartz...
2013-01-03 15:25:43 UpdateChecker [DEBUG] Quartz version update check failed:
                        java.io.IOException: Server returned HTTP response 
                        code: 503 for URL: long url here

How can I eliminate these? (Both the message and attempt to update)

我怎样才能消除这些?(消息和尝试更新)

回答by Reimeus

In quartz.properties, you can add

在 中quartz.properties,您可以添加

org.quartz.scheduler.skipUpdateCheck=true

In code, this would look like:

在代码中,这看起来像:

Properties props = new Properties();
props.setProperty("org.quartz.scheduler.skipUpdateCheck","true");

// set other properties ...such as
props.setProperty("org.quartz.jobStore.class", "org.quartz.simpl.RAMJobStore");
props.setProperty("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
props.setProperty("org.quartz.threadPool.threadCount", "4");

SchedulerFactory schdFact = new StdSchedulerFactory(props);

Edit:

编辑:

From @Stephan202's comment below you can use the constant PROP_SCHED_SKIP_UPDATE_CHECK

从@Stephan202 下面的评论中,您可以使用常量PROP_SCHED_SKIP_UPDATE_CHECK

The code in that case would be

在这种情况下的代码将是

props.setProperty(StdSchedulerFactory.PROP_SCHED_SKIP_UPDATE_CHECK,"true");