mirror of
https://github.com/chenasraf/DefinitelyTyped-tools.git
synced 2026-05-18 01:49:03 +00:00
Move app insights initialization earlier
This commit is contained in:
@@ -8,6 +8,11 @@ import full from "./full";
|
||||
import { getFunctionTimeoutSeconds, lockFilePath } from "./lib/settings";
|
||||
|
||||
export default function main() {
|
||||
if (process.env.APPINSIGHTS_INSTRUMENTATIONKEY) {
|
||||
applicationinsights.setup().start();
|
||||
console.log("Done initialising App Insights");
|
||||
}
|
||||
|
||||
return withFileLock(lockFilePath, async () => {
|
||||
const githubAccessToken = await getSecret(Secret.GITHUB_ACCESS_TOKEN);
|
||||
const dry = !!(yargs.argv.dry || process.env.WEBHOOK_FORCE_DRY);
|
||||
@@ -16,10 +21,6 @@ export default function main() {
|
||||
console.log("The environment variable GITHUB_ACCESS_TOKEN must be set.");
|
||||
} else {
|
||||
console.log(`=== ${dry ? "DRY" : "PRODUCTION"} RUN ===`);
|
||||
if (process.env.APPINSIGHTS_INSTRUMENTATIONKEY) {
|
||||
applicationinsights.setup().start();
|
||||
console.log("Done initialising App Insights");
|
||||
}
|
||||
const fetcher = new Fetcher();
|
||||
const log = loggerWithErrors()[0];
|
||||
log.info("");
|
||||
|
||||
Reference in New Issue
Block a user