2

I have created a scheduled job with Quartz that will run every minute. The job is created from following guide: http://geekswithblogs.net/TarunArora/archive/2012/11/17/quartz.net-writing-your-first-hello-world-job.aspx

The problem is that when the service is stopped and restarted the job is no longer in the scheduler.

How do I keep the scheduled job in the list?

Thanks for helping.

4

1 回答 1

2

David F 和 bland 帮我找到了答案。我在名为quartz_jobs.xml 的XML 文件中添加了我的工作。

<job>
    <name>MyJob</name>
    <group>MyGroup</group>
    <description>Job for MyJob</description>
    <job-type>ScheduledDownloader.DownloadJob, ScheduledDownloader</job-type>
    <durable>true</durable>
    <recover>false</recover>
</job>

<trigger>
    <cron>
        <name>MyJob</name>
        <group>MyGroup</group>
        <description>Cron trigger for MyJob</description>
        <job-name>MyJob</job-name>
        <job-group>MyGroup</job-group>
        <misfire-instruction>SmartPolicy</misfire-instruction>
        <cron-expression>0 0/1 * 1/1 * ? *</cron-expression>
    </cron>
</trigger>

再次感谢您的快速帮助,这确实让我很开心。

于 2013-10-17T07:55:20.703 回答