我需要为服务器每分钟运行一次cron

rate: cron(* * * * * *)


但这让我出错

  An error occurred: SendNotificationsEventsRuleSchedule1 - Parameter ScheduleExpression is not valid. (Service: AmazonCloudWatchEvents; Status Code: 400; Error Code: ValidationException; Request ID:XXXXXXXXXX.

最佳答案

根据联机帮助页,它应该类似于以下内容:

rate: rate(1 minute)


或者从serverless.yml获取更多信息:

functions:
  aggregate:
    handler: statistics.handler
    events:
      - schedule:
          rate: rate(1 minute)


更多信息https://serverless.com/framework/docs/providers/aws/events/schedule/

关于node.js - 如何每分钟在无服务器中运行cron?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/57624100/

10-10 00:43
查看更多