0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Fixed LeakyBucket params for test and live mode

no-issue

These were the wrong way round initially, and not caught when testing
with live api keys
This commit is contained in:
Fabien O'Carroll 2020-08-18 10:38:22 +01:00
parent 4fb68c6b19
commit 2d347cd5fd

View file

@ -1,8 +1,8 @@
const debug = require('ghost-ignition').debug('stripe-request');
const LeakyBucket = require('leaky-bucket');
const EXPECTED_API_EFFICIENCY = 0.95;
const liveBucket = new LeakyBucket(EXPECTED_API_EFFICIENCY * 25, 1);
const testBucket = new LeakyBucket(EXPECTED_API_EFFICIENCY * 100, 1);
const liveBucket = new LeakyBucket(EXPECTED_API_EFFICIENCY * 100, 1);
const testBucket = new LeakyBucket(EXPECTED_API_EFFICIENCY * 25, 1);
module.exports = function createStripeRequest(makeRequest) {
return async function stripeRequest(stripe, ...args) {