Improve error handling

This commit is contained in:
tdurieux
2026-05-06 18:43:36 +03:00
parent aae6eae6eb
commit da78708b7b
16 changed files with 360 additions and 49 deletions
+10 -1
View File
@@ -179,7 +179,16 @@ export async function getToken(repository: Repository) {
} else {
repository.owner.model.accessTokenDates.github = new Date();
}
await repository.owner.model.save();
await UserModel.updateOne(
{ _id: repository.owner.model._id },
{
$set: {
"accessTokens.github": refreshed,
"accessTokenDates.github":
repository.owner.model.accessTokenDates.github,
},
}
).exec();
return refreshed;
}
}