amazon-web-services - Aws Lambda function triggers on a delay time for 2 out of 3 cron jobs
问题描述
I have a Lambda function that has 3 event triggers here are the Cron job for each:
Cron 1: cron(50/1 22 * * ? *)
Cron 2: cron(50/1 12 * * ? *)
Cron 3: cron(*/15 * * * ? *)
Now Cron 2 Timestamp logs reads as follows, which is ok. Notice that it starts 2-3 seconds into the intended trigger:
10
2021-07-10T05:59:03.867-07:00
11
2021-07-10T05:59:03.867-07:00
12
2021-07-10T05:59:02.314-07:00
START
13
2021-07-10T05:58:02.988-07:00
END
14
2021-07-10T05:58:02.988-07:00
15
2021-07-10T05:58:02.547-07:00
START
BUT Cron 1 & 3 starts over 30+ seconds into the intended trigger. I compared everything possible and there are no settings that are different (to my knowledge). Any idea why 2 of the 3 events have a delay but one doesn't? I understand a small 1-5 second delay by reading here https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html but somethings seems to be off.
2021-07-10T06:30:37.253-07:00
2
2021-07-10T06:30:37.253-07:00
3
2021-07-10T06:30:33.929-07:00
4
2021-07-10T06:15:36.931-07:00
5
2021-07-10T06:15:36.931-07:00
6
2021-07-10T06:15:33.881-07:00
7
2021-07-10T06:00:34.037-07:00
8
2021-07-10T06:00:34.037-07:00
9
2021-07-10T06:00:33.596-07:00
解决方案
Event Bridge的精度为一分钟:
所有计划的事件都使用 UTC+0 时区,计划的最小精度为一分钟。您计划的规则在那一分钟内运行,但不是在精确的第 0 秒内运行。
因此,您的延迟非常好,并且在 1 分钟的间隔内。
推荐阅读
- javascript - 在 vuejs 组件中添加 window.resize 事件不能独立工作
- ios - 如何使用具有正确值的 Swift 在 CoreData 中保存解码值
- python - 使用 requests.get() 从 Reddit 提交图像 URL 时遇到问题
- automation - 为 msi 安装程序创建响应文件
- angular - 如果 'nb-card' 是一个 Angular 组件,则验证它是这个模块的一部分
- javascript - 在 Lerna Monorepo 中检测循环依赖
- groovy - 类类型转换?
- snmp - 如何使三个不同的库可以访问 MIB 配置文件?
- r - jupyter notebook中的代码语法有什么问题
- java - 是否有支持 NIST 标准的随机生成器的 Java 8 实现?