如何避免在 aws 步骤函数中同时执行 [英] How to avoid simultaneous execution in aws step function

查看:31
本文介绍了如何避免在 aws 步骤函数中同时执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我有一个用例,云监视规则将每 5 分钟触发一次步进函数.如果 step 函数中已经运行了一个执行,我想要一个逻辑来跳过开始另一个执行.有什么办法吗?

Currently I have a use case that a cloud watch rule will trigger a step function every 5 minutes. I want to have a logic to skip starting another execution if there is one execution already running in step function. Any way to do that?

推荐答案

与其让 CloudWatch 事件规则直接触发 Step Function,您还可以让它触发 Lambda 函数.Lambda 函数可以通过 ListExecutions API.如果没有,Lambda 函数可以通过 StartExecution 开始新的执行API.

Instead of having your CloudWatch event rule trigger the Step Function directly, you could have it trigger a Lambda function. The Lambda function could check if there are any Step Function executions in the RUNNING state, via the ListExecutions API. If not, the Lambda function could start a new execution via the StartExecution API.

这篇关于如何避免在 aws 步骤函数中同时执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆