INNER CODE UNIT · TypeScript
isLastAttempt
Beever-AI/beever-atlas · bot/src/index.ts:701
const isLastAttempt = attempt === delays.length - 1;
if (isLastAttempt) {
console.warn(`Startup sync: all ${delays.length} attempts failed. Falling back to .env credentials.`);
await fallbackToEnvCredentials(chatManager);
} else {
const waitMs = delays[attempt];
console.warn(`Startup sync: attempt ${attempt + 1} failed (${safeErrorMessage(err)}), retrying in ${waitMs}ms...`);
await new Promise((r) => setTimeout(r, waitMs));
}
}
}
}
async function registerTeamsFromEnvIfPresent(
chatManager: ChatManager,
logPrefix: string,
): Promise<boolean> {
const teamsAppId = process.env.TEAMS_APP_ID;