Skip to content

Set time interval

Now you will set the duration of the Timed Holder. When the duration of the Timed Holder is over, the holder will be reset.

cron: <cron-expression>

The plugin provides some built-in cron expressions in case you don’t want to make the expression yourself:

  • HOURLY: The holder would be reset at the start of the next hour
  • DAILY: The holder would be reset at the start of the next day
  • WEEKLY: The holder would be reset at the start of the next week
  • MONTHLY: The holder would be reset at the start of the next month
  • YEARLY: The holder would be reset at the start of the next year

If your case is not covered in the built-in expressions, read the next section on how to customize your own cron

By default, the cron is a QUARTZ expression, which is usually an expression with 7 parts.

You can go to this page to generate your own cron expression.

If you don’t use Quartz expression and want to use another cron format, you can set the cron-type option, along with your cron expression:

cron-type: <cron-type>
cron: <cron-expression>

Available types for cron-type include:

  • CRON4J: Go to this page to learn the expression
  • QUARTZ: The default type of this plugin.
  • UNIX: Follow the UNIX cron expression. Go to this page to generate your own cron expression
  • SPRING: The cron format from Spring Framework
  • SPRING53: The cron format from Spring Framework, starting from version 5.3
  • SIMPLE: Set the duration for the next reset (e.g. 30s, 1m 30s).

The SIMPLE type allows you to set the duration for the next reset. Instead of setting a specific time for the reset, you set the duration from the last reset.

The supported time unit range:

  • s: Seconds
  • m: Minutes
  • h: Hours
  • d: Days
  • w: Weeks
  • M: Months
  • y: Years

Example format: 30s, 1m 30s, 1h 30m, 1d 12h.

holders:
# The holder that resets every day
jump_daily:
top: jump
cron: DAILY
# The holder that resets every month
jump_monthly:
top: jump
cron: MONTHLY
# The holder that resets every half of the month
jump_custom_time:
top: jump
cron: 0 0 0 1,15 * ? *
# The holder that resets every day (Use UNIX cron format)
jump_custom_cron_type:
top: jump
cron-type: UNIX
cron: 0 0 * * *
# The holder that resets every 30 seconds
jump_simple_time:
top: jump
cron-type: SIMPLE
cron: 30s
# The holder that resets every 1 minute 30 seconds
jump_simple_time_combined:
top: jump
cron-type: SIMPLE
cron: 1m 30s