gpt4 book ai didi

spring Scheduler - 每周运行一次

转载 作者:行者123 更新时间:2023-12-04 14:34:26 26 4
gpt4 key购买 nike

我必须编写一个每周运行一次的 spring 调度程序,比如每周一凌晨 1 点。它的 cron 表达式是什么,我们可以使用 fixedDely 来归档它。

最佳答案

您可以为此使用 cron:

@Scheduled(cron = "0 0 1 * * MON")

cron 表达式从左到右的顺序是:
second, minute, hour, day of month, month, day(s) of week

关于spring Scheduler - 每周运行一次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50296823/

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