Skip to content

Commit 2ffcfe8

Browse files
add support for running locally with configured update interval and backoff
1 parent 6ae8377 commit 2ffcfe8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

local.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ const {
1616
imageOverride,
1717
envPassthrough,
1818
remote,
19+
updateInterval,
20+
updateBackOff,
1921
} = yargs
2022
.option("project-name", {
2123
alias: "p",
@@ -56,6 +58,17 @@ const {
5658
describe: "remote name to publish to",
5759
default: "origin",
5860
type: "string",
61+
})
62+
.option("update-interval", {
63+
describe: "Interval in seconds between API calls for fetching updates",
64+
default: 30,
65+
type: "number",
66+
})
67+
.option("update-backoff", {
68+
describe:
69+
"Base update interval back-off value when encountering API rate-limiting",
70+
default: 15,
71+
type: "number",
5972
}).argv;
6073

6174
const BRANCH_NAME = uuid();
@@ -71,11 +84,16 @@ const params = cb.inputs2Parameters({
7184
envPassthrough,
7285
});
7386

87+
const config = {
88+
updateInterval: updateInterval * 1000,
89+
updateBackOff: updateBackOff * 1000,
90+
};
91+
7492
const sdk = cb.buildSdk();
7593

7694
pushBranch(remote, BRANCH_NAME);
7795

78-
cb.build(sdk, params)
96+
cb.build(sdk, params, config)
7997
.then(() => deleteBranch(remote, BRANCH_NAME))
8098
.catch((err) => {
8199
deleteBranch(remote, BRANCH_NAME);

0 commit comments

Comments
 (0)