Java Code Examples for com.ruoyi.quartz.domain.SysJob#getMisfirePolicy()

The following examples show how to use com.ruoyi.quartz.domain.SysJob#getMisfirePolicy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScheduleUtils.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 设置定时任务策略
 */
public static CronScheduleBuilder handleCronScheduleMisfirePolicy(SysJob job, CronScheduleBuilder cb)
        throws TaskException
{
    switch (job.getMisfirePolicy())
    {
        case ScheduleConstants.MISFIRE_DEFAULT:
            return cb;
        case ScheduleConstants.MISFIRE_IGNORE_MISFIRES:
            return cb.withMisfireHandlingInstructionIgnoreMisfires();
        case ScheduleConstants.MISFIRE_FIRE_AND_PROCEED:
            return cb.withMisfireHandlingInstructionFireAndProceed();
        case ScheduleConstants.MISFIRE_DO_NOTHING:
            return cb.withMisfireHandlingInstructionDoNothing();
        default:
            throw new TaskException("The task misfire policy '" + job.getMisfirePolicy()
                    + "' cannot be used in cron schedule tasks", Code.CONFIG_ERROR);
    }
}
 
Example 2
Source File: ScheduleUtils.java    From ruoyiplus with MIT License 6 votes vote down vote up
public static CronScheduleBuilder handleCronScheduleMisfirePolicy(SysJob job, CronScheduleBuilder cb)
        throws TaskException
{
    switch (job.getMisfirePolicy())
    {
        case ScheduleConstants.MISFIRE_DEFAULT:
            return cb;
        case ScheduleConstants.MISFIRE_IGNORE_MISFIRES:
            return cb.withMisfireHandlingInstructionIgnoreMisfires();
        case ScheduleConstants.MISFIRE_FIRE_AND_PROCEED:
            return cb.withMisfireHandlingInstructionFireAndProceed();
        case ScheduleConstants.MISFIRE_DO_NOTHING:
            return cb.withMisfireHandlingInstructionDoNothing();
        default:
            throw new TaskException("The task misfire policy '" + job.getMisfirePolicy() + "' cannot be used in cron schedule tasks", Code.CONFIG_ERROR);
    }
}
 
Example 3
Source File: ScheduleUtils.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
private static CronScheduleBuilder handleCronScheduleMisfirePolicy(SysJob job, CronScheduleBuilder cb)
        throws TaskException {
    switch (job.getMisfirePolicy()) {
        case ScheduleConstants.MISFIRE_DEFAULT:
            return cb;
        case ScheduleConstants.MISFIRE_IGNORE_MISFIRES:
            return cb.withMisfireHandlingInstructionIgnoreMisfires();
        case ScheduleConstants.MISFIRE_FIRE_AND_PROCEED:
            return cb.withMisfireHandlingInstructionFireAndProceed();
        case ScheduleConstants.MISFIRE_DO_NOTHING:
            return cb.withMisfireHandlingInstructionDoNothing();
        default:
            throw new TaskException("The task misfire policy '" + job.getMisfirePolicy() + "' cannot be used in cron schedule tasks", Code.CONFIG_ERROR);
    }
}