Skip to content

Commit

Permalink
Merge pull request #45 from balena-io-modules/specify-api-client-retr…
Browse files Browse the repository at this point in the history
…y-param

release/createClient: Allow specifying the "retry" options
  • Loading branch information
thgreasi authored Dec 5, 2023
2 parents 736412e + b89b42a commit 7df6307
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/release/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pMap = require('p-map');
import type { PinejsClientCore } from 'pinejs-client-core';
import type { PinejsClientCore, RetryParameters } from 'pinejs-client-core';
import { PinejsClientRequest } from 'pinejs-client-request';
import * as models from './models';
import { Dict } from './types';
Expand All @@ -21,6 +21,8 @@ export interface ClientConfig {
* `Bearer <authtoken>`.
*/
auth: string;

retry?: RetryParameters;
}

export function createClient(config: ClientConfig): PinejsClientRequest {
Expand All @@ -31,6 +33,7 @@ export function createClient(config: ClientConfig): PinejsClientRequest {
Authorization: config.auth,
},
},
retry: config.retry,
});
}

Expand Down

0 comments on commit 7df6307

Please sign in to comment.