Skip to content

Commit

Permalink
fixup! feat(create-clients): Expose Rate limit configs when creating …
Browse files Browse the repository at this point in the history
…clients
  • Loading branch information
Khaledgarbaya committed Nov 3, 2016
1 parent 5fe2810 commit 49a6f78
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/utils/create-clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ export default function createClients (opts) {
clients.source = {
spaceId: opts.sourceSpace
}
let rateLimit = opts.rateLimit || 6
let rateLimitPeriod = opts.rateLimitPeriod || 1000

if (opts.sourceDeliveryToken) {
clients.source.delivery = contentful.createClient({
space: opts.sourceSpace,
accessToken: opts.sourceDeliveryToken,
host: opts.deliveryHost,
port: opts.deliveryPort,
rateLimit: opts.rateLimit,
rateLimitPeriod: opts.rateLimitPeriod,
rateLimit: rateLimit,
rateLimitPeriod: rateLimitPeriod,
insecure: opts.deliveryInsecure
})
}
Expand All @@ -37,8 +39,8 @@ export default function createClients (opts) {
accessToken: opts.sourceManagementToken,
host: opts.managementHost,
port: opts.managementPort,
rateLimit: opts.rateLimit,
rateLimitPeriod: opts.rateLimitPeriod,
rateLimit: rateLimit,
rateLimitPeriod: rateLimitPeriod,
insecure: opts.managementInsecure
})
}
Expand Down

0 comments on commit 49a6f78

Please sign in to comment.