Skip to content

Commit

Permalink
Merge pull request #1355 from opencomponents/retry-options
Browse files Browse the repository at this point in the history
add retry options to compiled client
  • Loading branch information
ricardo-devis-agullo committed Feb 3, 2024
2 parents 23f9031 + 428ecd4 commit 832b749
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"multer": "^1.4.3",
"nice-cache": "^0.0.5",
"oc-client": "^4.0.1",
"oc-client-browser": "^1.7.7",
"oc-client-browser": "^1.7.8",
"oc-empty-response-handler": "^1.0.2",
"oc-get-unix-utc-timestamp": "^1.0.6",
"oc-s3-storage-adapter": "^2.1.1",
Expand All @@ -128,4 +128,4 @@
"universalify": "^2.0.0",
"yargs": "^17.7.2"
}
}
}
10 changes: 8 additions & 2 deletions src/registry/domain/options-sanitiser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const DEFAULT_NODE_KEEPALIVE_MS = 5000;

export interface Input extends Partial<Omit<Config, 'beforePublish'>> {
baseUrl: string;
compileClient?: boolean;
compileClient?: boolean | { retryLimit?: number; retryInterval?: number };
}

export default function optionsSanitiser(input: Input): Config {
Expand Down Expand Up @@ -59,7 +59,13 @@ export default function optionsSanitiser(input: Input): Config {
}

if (options.compileClient) {
options.compiledClient = compileSync({ templates: options.templates });
const clientOptions =
typeof options.compileClient === 'boolean' ? {} : options.compileClient;

options.compiledClient = compileSync({
templates: options.templates,
...clientOptions
});
}

if (!options.dependencies) {
Expand Down

0 comments on commit 832b749

Please sign in to comment.