diff --git a/retry.js b/retry.js index 3a33b3cb..89150bad 100644 --- a/retry.js +++ b/retry.js @@ -1,6 +1,7 @@ 'use strict' const retry = require('p-retry') +const defaultProfile = require('./lib/default-profile') const retryDefaults = { retries: 3, @@ -10,7 +11,8 @@ const retryDefaults = { const withRetrying = (profile, retryOpts = {}) => { retryOpts = Object.assign({}, retryDefaults, retryOpts) - const {request} = profile + // https://github.com/public-transport/hafas-client/issues/76#issuecomment-574408717 + const {request} = {...defaultProfile, ...profile} const retryingRequest = (...args) => { const attempt = () => { diff --git a/throttle.js b/throttle.js index 233a7c7b..bf3557a1 100644 --- a/throttle.js +++ b/throttle.js @@ -1,9 +1,11 @@ 'use strict' const throttle = require('p-throttle') +const defaultProfile = require('./lib/default-profile') const withThrottling = (profile, limit = 5, interval = 1000) => { - const {request} = profile + // https://github.com/public-transport/hafas-client/issues/76#issuecomment-574408717 + const {request} = {...defaultProfile, ...profile} return { ...profile,