任何人都可以在这里解决我的问题,我想在一个AWS Lambda函数上同时(每个午夜)使用不同的键运行多个计划的事件。
我的serverless.yaml设置如下:
service: shopfeed-xml-generator
plugins:
- serverless-offline
provider:
name: aws
runtime: nodejs8.10
region: eu-west-1
timeout: 900
deploymentBucket:
name: **bucket name**
environment:
NODE_ENV: production
functions:
runShopFeed:
handler: index.runShopFeed
name: shopfeed-xml-generation
events:
- schedule:
name: "Shopfeed IE"
description: "Run the IE shopfeed xml generation at 00:00 AM Every day"
enabled: true
rate: cron(0 0 * * ? *)
input:
key: 'IE'
- schedule:
name: "Shopfeed ES"
description: "Run the ES shopfeed xml generation at 00:00 AM Every day"
enabled: true
rate: cron(0 0 * * ? *)
input:
key: 'ES'
- schedule:
name: "Shopfeed PT"
description: "Run the PT shopfeed xml generation at 00:00 AM Every day"
enabled: true
rate: cron(0 0 * * ? *)
input:
key: 'PT'
- schedule:
name: "Shopfeed CH_DE"
description: "Run the CH_DE shopfeed xml generation at 00:00 AM Every day"
enabled: true
rate: cron(0 0 * * ? *)
input:
key: 'CH_DE'
- schedule:
name: "Shopfeed CH_FR"
description: "Run the CH_FR shopfeed xml generation at 00:00 AM Every day"
enabled: true
rate: cron(0 0 * * ? *)
input:
key: 'CH_FR'
- schedule:
name: "Shopfeed CH_IT"
description: "Run the CH_IT shopfeed xml generation at 00:00 AM Every day"
enabled: true
rate: cron(0 0 * * ? *)
input:
key: 'CH_IT'
- schedule:
name: "Shopfeed UK"
description: "Run the UK shopfeed xml generation at 00:00 AM Every day"
enabled: true
rate: cron(0 0 * * ? *)
input:
key: 'UK'
environment:
DEBUG: false
VERBOSE: false
DEV_ENV: false
SHORT_REQUEST: false
UPLOAD_FILE_TO_S3: true
DEBUG_COUNTRY: "NONE"
在我的AWS Lambda管理控制台中,我已将DEBUG设置为true并设置DEBUG_COUNTRY,并且当我运行测试时,文件和功能成功运行,因此我知道代码可以正常工作。我相信无服务器是问题。
我是否将DEBUG设置为True并将DEBUG_COUNTRY设置为一个值,该值表示Serverless被超越了?
我对问题可能是什么感到困惑。