UBERF-8469: Fix exit from github service (#6921)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-10-15 10:04:39 +05:00
committed by GitHub
parent 81e02eb8ca
commit a714be51e9
13 changed files with 89 additions and 9 deletions
@@ -457,6 +457,9 @@ export class CommentSyncManager implements DocSyncManager {
repositories: GithubIntegrationRepository[]
): Promise<void> {
for (const repo of repositories) {
if (this.provider.isClosing()) {
break
}
const syncKey = `${repo._id}:comment`
if (repo.githubProject === undefined || !repo.enabled || integration.synchronized.has(syncKey)) {
if (!repo.enabled) {
@@ -487,6 +490,9 @@ export class CommentSyncManager implements DocSyncManager {
})
try {
for await (const data of i) {
if (this.provider.isClosing()) {
break
}
const comments: CommentExternalData[] = data.data as any
this.ctx.info('retrieve comments for', {
repo: repo.name,