mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-29 03:21:13 +00:00
UBERF-8120: Fix high CPU usage in github service (#6573)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
9095853f7b
commit
310f18c3ff
@ -248,7 +248,7 @@ export class CommentSyncManager implements DocSyncManager {
|
||||
): Promise<DocumentUpdate<DocSyncInfo> | undefined> {
|
||||
const container = await this.provider.getContainer(info.space)
|
||||
if (container?.container === undefined) {
|
||||
return {}
|
||||
return { needSync: githubSyncVersion }
|
||||
}
|
||||
if (info.external === undefined) {
|
||||
// TODO: Use selected repository
|
||||
|
@ -325,11 +325,13 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
|
||||
derivedClient: TxOperations
|
||||
): Promise<DocumentUpdate<DocSyncInfo> | undefined> {
|
||||
const container = await this.provider.getContainer(info.space)
|
||||
if (container?.container === undefined) {
|
||||
return { needSync: githubSyncVersion }
|
||||
}
|
||||
if (
|
||||
container?.container === undefined ||
|
||||
((container.project.projectNodeId === undefined ||
|
||||
(container.project.projectNodeId === undefined ||
|
||||
!container.container.projectStructure.has(container.project._id)) &&
|
||||
syncConfig.MainProject)
|
||||
syncConfig.MainProject
|
||||
) {
|
||||
this.ctx.error('Not syncing no structure', { url: info.url })
|
||||
return { needSync: '' }
|
||||
|
@ -103,7 +103,7 @@ export class ProjectsSyncManager implements DocSyncManager {
|
||||
): Promise<DocumentUpdate<DocSyncInfo> | undefined> {
|
||||
const container = await this.provider.getContainer(info.space)
|
||||
if (container?.container === undefined) {
|
||||
return {}
|
||||
return { needSync: githubSyncVersion }
|
||||
}
|
||||
|
||||
const okit = await this.provider.getOctokit(container.project.createdBy as Ref<PersonAccount>)
|
||||
|
@ -957,13 +957,15 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS
|
||||
derivedClient: TxOperations
|
||||
): Promise<DocumentUpdate<DocSyncInfo> | undefined> {
|
||||
const container = await this.provider.getContainer(info.space)
|
||||
if (container?.container === undefined) {
|
||||
return { needSync: githubSyncVersion }
|
||||
}
|
||||
if (
|
||||
container?.container === undefined ||
|
||||
((container.project.projectNodeId === undefined ||
|
||||
(container.project.projectNodeId === undefined ||
|
||||
!container.container.projectStructure.has(container.project._id)) &&
|
||||
syncConfig.MainProject)
|
||||
syncConfig.MainProject
|
||||
) {
|
||||
return { needSync: '' }
|
||||
return { needSync: githubSyncVersion }
|
||||
}
|
||||
|
||||
const pullRequestExternal = info.external as unknown as PullRequestExternalData
|
||||
|
@ -307,7 +307,7 @@ export class ReviewCommentSyncManager implements DocSyncManager {
|
||||
): Promise<DocumentUpdate<DocSyncInfo> | undefined> {
|
||||
const container = await this.provider.getContainer(info.space)
|
||||
if (container?.container === undefined) {
|
||||
return {}
|
||||
return { needSync: githubSyncVersion }
|
||||
}
|
||||
if (parent === undefined) {
|
||||
return { needSync: githubSyncVersion }
|
||||
|
@ -263,7 +263,7 @@ export class ReviewThreadSyncManager implements DocSyncManager {
|
||||
): Promise<DocumentUpdate<DocSyncInfo> | undefined> {
|
||||
const container = await this.provider.getContainer(info.space)
|
||||
if (container?.container === undefined) {
|
||||
return {}
|
||||
return { needSync: githubSyncVersion }
|
||||
}
|
||||
if (parent === undefined) {
|
||||
return { needSync: githubSyncVersion }
|
||||
|
@ -281,7 +281,7 @@ export class ReviewSyncManager implements DocSyncManager {
|
||||
): Promise<DocumentUpdate<DocSyncInfo> | undefined> {
|
||||
const container = await this.provider.getContainer(info.space)
|
||||
if (container?.container === undefined) {
|
||||
return {}
|
||||
return { needSync: githubSyncVersion }
|
||||
}
|
||||
if (parent === undefined) {
|
||||
return { needSync: githubSyncVersion }
|
||||
|
Loading…
Reference in New Issue
Block a user