mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 15:03:16 +00:00
fix: better logging for gh token refresh
This commit is contained in:
parent
d9feebb89d
commit
005190e7bd
1 changed files with 3 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ const logger = createLogger(LogLevel.INFO, "GitHub-API");
|
|||
|
||||
async function getInstallationTokenAndUpdateConfig() {
|
||||
try {
|
||||
logger.info("Fetching a new GitHub installation token.");
|
||||
const config = getConfig();
|
||||
const encryptionSecret = process.env.SECRETS_ENCRYPTION_KEY;
|
||||
if (!encryptionSecret) {
|
||||
|
|
@ -30,6 +31,7 @@ async function getInstallationTokenAndUpdateConfig() {
|
|||
const token = await getInstallationToken(installationId, appId, privateKey);
|
||||
const encryptedToken = encryptSecret(token, encryptionSecret);
|
||||
updateConfig(GITHUB_INSTALLATION_ID, encryptedToken);
|
||||
logger.info("Successfully fetched a new GitHub installation token.");
|
||||
return token;
|
||||
} catch (e) {
|
||||
logger.error("Failed to get installation token and update config", {
|
||||
|
|
@ -77,6 +79,7 @@ async function withGitHubRetry<T>(
|
|||
}
|
||||
|
||||
logger.error(errorMessage, {
|
||||
numRetries,
|
||||
...additionalLogFields,
|
||||
...(errorFields ?? { error }),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue