Skip to content

Commit cc97cae

Browse files
s
1 parent c59cdba commit cc97cae

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

packages/backend/src/ee/accountPermissionSyncer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ export class AccountPermissionSyncer {
122122
data: accounts.map(account => ({
123123
accountId: account.id,
124124
})),
125+
include: {
126+
account: true,
127+
}
125128
});
126129

127130
await this.queue.addBulk(jobs.map((job) => ({
@@ -132,6 +135,8 @@ export class AccountPermissionSyncer {
132135
opts: {
133136
removeOnComplete: env.REDIS_REMOVE_ON_COMPLETE,
134137
removeOnFail: env.REDIS_REMOVE_ON_FAIL,
138+
// Priority 1 (high) for never-synced, Priority 2 (normal) for re-sync
139+
priority: job.account.permissionSyncedAt === null ? 1 : 2,
135140
}
136141
})))
137142
}

packages/backend/src/ee/repoPermissionSyncer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ export class RepoPermissionSyncer {
126126
data: repos.map(repo => ({
127127
repoId: repo.id,
128128
})),
129+
include: {
130+
repo: true,
131+
}
129132
});
130133

131134
await this.queue.addBulk(jobs.map((job) => ({
@@ -136,6 +139,8 @@ export class RepoPermissionSyncer {
136139
opts: {
137140
removeOnComplete: env.REDIS_REMOVE_ON_COMPLETE,
138141
removeOnFail: env.REDIS_REMOVE_ON_FAIL,
142+
// Priority 1 (high) for never-synced, Priority 2 (normal) for re-sync
143+
priority: job.repo.permissionSyncedAt === null ? 1 : 2,
139144
}
140145
})))
141146
}

0 commit comments

Comments
 (0)