Skip to content

Commit

Permalink
moving scope of retrieveApiToken to inside the while loop so that it …
Browse files Browse the repository at this point in the history
…will get called every time
  • Loading branch information
harvardpan committed Sep 15, 2024
1 parent 435ae89 commit b0671ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ function sleep(ms) {

(async () => {
await init(); // connect to HCP Vault Secrets and populate environment variables
const apiToken = await retrieveApiToken();

while (true) {
const apiToken = await retrieveApiToken();
await main(apiToken);
await sleep(config.runInterval * 1000); // multiply by 1000 as sleep takes milliseconds
}
Expand Down

0 comments on commit b0671ec

Please sign in to comment.