Skip to content

Commit

Permalink
Cloud Run Fix (#74)
Browse files Browse the repository at this point in the history
Signed-off-by: Zachary Blasczyk <[email protected]>
  • Loading branch information
zacharyblasczyk authored Sep 26, 2024
1 parent d73832d commit f79f33c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions integrations/terraform-cloud-scanner/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ logger.info(
`Starting Terraform Cloud scanner for organization '${env.TFE_ORGANIZATION}' in workspace '${env.CTRLPLANE_WORKSPACE_ID}'`,
);

scan().catch((error) => {
logger.error("Initial scan failed:", error);
});

if (env.CRON_ENABLED.toLowerCase() === "true") {
logger.info(`Cron job enabled. Scheduling scans at '${env.CRON_TIME}'`);
new CronJob(env.CRON_TIME, () => {
Expand All @@ -21,3 +17,11 @@ if (env.CRON_ENABLED.toLowerCase() === "true") {
});
}).start();
}

scan()
.catch((error) => {
logger.error("Initial scan failed:", error);
})
.finally(() => {
process.exit(0);
});

0 comments on commit f79f33c

Please sign in to comment.