Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Set expiration on bottleneck jobs #167

Open
dobesv opened this issue Apr 16, 2019 · 0 comments
Open

Set expiration on bottleneck jobs #167

dobesv opened this issue Apr 16, 2019 · 0 comments

Comments

@dobesv
Copy link

dobesv commented Apr 16, 2019

When using Bottleneck in clustering mode, it is strongly recommended to set expiration on every job.

See https://github.com/SGrondin/bottleneck#important-considerations-when-clustering

It would be great if hubspot would pass an expiration to calls to this.limiter.schedule, e.g.

return this.checkApiLimit(params).then(() => {
      this.emit('apiCall', params)
      return this.limiter.schedule({ expiration: this.apiTimeout }, () =>
        request(params)
          .then(res => {
            this.updateApiLimit(res)
            return res
          })
          .then(res => res.body)
      ) // limit the number of concurrent requests
    })

then if I setup clustering mode for hubspot's bottleneck instance, it will apply this recommendation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant