juanjoDiaz / serverless-plugin-warmup

Keep your lambdas warm during winter. ♨
MIT License
1.11k stars 114 forks source link

Warmup schedule fixed at 5min despite configuration #276

Closed xprixpri closed 3 years ago

xprixpri commented 3 years ago

Hi we've been using this plugin for a while now, but this month I noticed that our schedule is being configured at rate(5 minutes) despite our schedule being set to rate(500 minutes). Previously it was working fine. We did not change any configuration.

A check on Cloudwatch shows that the schedule is being set to rate(5 minutes). A check on Cloudformation Serverless stack also shows the CF yaml as 5min.

We always update to the latest plugin version during deployment so this is on the latest version.

Since then we've tried other schedules like: -schedule: 'cron(0/5 0-12 ? MON-FRI ) -schedule: rate(2 minutes) but they do not seem to have any change to the final CF stack and schedule in CW.

I notice similar reported issues on #236 and #247 but not sure if those are linked.

juanjoDiaz commented 3 years ago

Which version of Serverless and of the plugin are you using? Are you using any other plugin or setting that might affect the logs?

Could you provide a project where I can replicate this behaviour?

xprixpri commented 3 years ago

We are running serverless-plugin-warmup@5.2.2 and serverless@2.38.0

That's the only plugin we are using.

I can't share the project code but here's the config:

serverless.yml:

custom:
  warmup:
    default:
      enabled: false  #warmup only for selected functions
      name: ${self:custom.namePrefix}-warmer
      events: ${file(./warmup_var.yml):${self:provider.stage}-events}  #schedule and concurrency defined in warmup_var.yml
      concurrency: ${file(./warmup_var.yml):${self:provider.stage}-concurrency}
      prewarm: ${file(./warmup_var.yml):${self:provider.stage}-prewarm}
      role: ${file(./iam-roles.yml):${self:provider.stage}-WarmupRole}
      vpc: false

warmup_var.yml:

dev-events: 
  -schedule: rate(2 minutes) #'cron(0/5 0-12 ? * MON-SUN *)'
dev-concurrency: 1
dev-prewarm: true
xprixpri commented 3 years ago

Realized I was missing a space between the -schedule. Works now.