mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-22 12:22:23 +02:00
UBERF-8517: Fix github external sync (#6999)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -1334,12 +1334,13 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS
|
||||
): Promise<void> {
|
||||
await integration.syncLock.get(prj._id)
|
||||
|
||||
const ids = syncDocs.map((it) => (it.external as IssueExternalData).id).filter((it) => it !== undefined)
|
||||
const allSyncDocs = [...syncDocs]
|
||||
|
||||
let partsize = 50
|
||||
try {
|
||||
while (true) {
|
||||
const idsPart = ids.splice(0, partsize)
|
||||
const docsPart = allSyncDocs.splice(0, partsize)
|
||||
const idsPart = docsPart.map((it) => (it.external as IssueExternalData).id).filter((it) => it !== undefined)
|
||||
if (idsPart.length === 0) {
|
||||
break
|
||||
}
|
||||
@@ -1373,11 +1374,11 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS
|
||||
data: cutObjectArray(response)
|
||||
})
|
||||
}
|
||||
await this.syncIssues(github.class.GithubPullRequest, repo, issues, derivedClient)
|
||||
await this.syncIssues(github.class.GithubPullRequest, repo, issues, derivedClient, docsPart)
|
||||
} catch (err: any) {
|
||||
if (partsize > 1) {
|
||||
partsize = 1
|
||||
ids.push(...idsPart)
|
||||
allSyncDocs.push(...docsPart)
|
||||
this.ctx.warn('pull request external retrieval switch to one by one mode', {
|
||||
errors: err.errors,
|
||||
msg: err.message,
|
||||
|
||||
Reference in New Issue
Block a user