`
sillycat
  • 浏览: 2542335 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings

 
阅读更多
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings

CRON
00 01,13 * * *   every 1am and 1pm

The full configuration will be as follow:
service: orderinfo

provider:
  name: tencent
  region: ap-shanghai
  runtime: Nodejs8.9
  credentials: ~/.credentials.ini
  stage: prod
  memorySize: 128
  timeout: 60

plugins:
  - serverless-tencent-scf

package:
  excludeDevDependencies: false
  exclude:
    - .gitignore
    - .git/**
    - .serverless
    - .env
    - app.js
    - .DS_Stone
 
functions:
  order-manager:
    handler: handler.orderManager
    description: Task Manager to Fetch Tasks
    memorySize: 128
    timeout: 60
    events:
      - timer:
          name: cron_trigger
          parameters:
            cronExpression: '00 1 * * *'
            enable: true
      - apigw:
          name: order-manager_apigw
          parameters:
            stageName: release
            serviceId: service-mxgirfqn
            httpMethod: GET
  order-runner:
    handler: handler.ordeRunner
    description: Task Runner to Calculate
    events:
      - apigw:
          name: order-runner_apigw
          parameters:
            stageName: release
            serviceId: service-4qn5efd1
            httpMethod: POST
 

References:
https://serverless.com/framework/docs/providers/tencent/guide/events/
https://serverless.com/framework/docs/providers/tencent/guide/intro/
https://stackoverflow.com/questions/13993556/execute-crontab-twice-daily-at-00h-and-1330


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics