Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Added `maxAccountPermissionSyncJobConcurrency` and `maxRepoPermissionSyncJobConcurrency` settings to configure concurrency for permission sync jobs (default: 8). [#840](https://github.com/sourcebot-dev/sourcebot/pull/840)

## [4.10.21] - 2026-02-02

### Added
Expand Down
2 changes: 2 additions & 0 deletions docs/docs/configuration/config-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ The following are settings that can be provided in your config file to modify So
| `enablePublicAccess` **(deprecated)** | boolean | false | — | Use the `FORCE_ENABLE_ANONYMOUS_ACCESS` environment variable instead. |
| `experiment_repoDrivenPermissionSyncIntervalMs` | number | 24 hours | 1 | Interval at which the repo permission syncer should run. |
| `experiment_userDrivenPermissionSyncIntervalMs` | number | 24 hours | 1 | Interval at which the user permission syncer should run. |
| `maxAccountPermissionSyncJobConcurrency` | number | 8 | 1 | Concurrent account permission sync jobs. |
| `maxRepoPermissionSyncJobConcurrency` | number | 8 | 1 | Concurrent repo permission sync jobs. |

# Tokens

Expand Down
20 changes: 20 additions & 0 deletions docs/snippets/schemas/v3/index.schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@
"type": "number",
"description": "The interval (in milliseconds) at which the user permission syncer should run. Defaults to 24 hours.",
"minimum": 1
},
"maxAccountPermissionSyncJobConcurrency": {
"type": "number",
"description": "The number of account permission sync jobs to run concurrently. Defaults to 8.",
"minimum": 1
},
"maxRepoPermissionSyncJobConcurrency": {
"type": "number",
"description": "The number of repo permission sync jobs to run concurrently. Defaults to 8.",
"minimum": 1
}
},
"additionalProperties": false
Expand Down Expand Up @@ -215,6 +225,16 @@
"type": "number",
"description": "The interval (in milliseconds) at which the user permission syncer should run. Defaults to 24 hours.",
"minimum": 1
},
"maxAccountPermissionSyncJobConcurrency": {
"type": "number",
"description": "The number of account permission sync jobs to run concurrently. Defaults to 8.",
"minimum": 1
},
"maxRepoPermissionSyncJobConcurrency": {
"type": "number",
"description": "The number of repo permission sync jobs to run concurrently. Defaults to 8.",
"minimum": 1
}
},
"additionalProperties": false
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/ee/accountPermissionSyncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class AccountPermissionSyncer {
});
this.worker = new Worker<AccountPermissionSyncJob>(QUEUE_NAME, this.runJob.bind(this), {
connection: redis,
concurrency: 1,
concurrency: this.settings.maxAccountPermissionSyncJobConcurrency,
});
this.worker.on('completed', this.onJobCompleted.bind(this));
this.worker.on('failed', this.onJobFailed.bind(this));
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/ee/repoPermissionSyncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class RepoPermissionSyncer {
});
this.worker = new Worker<RepoPermissionSyncJob>(QUEUE_NAME, this.runJob.bind(this), {
connection: redis,
concurrency: 1,
concurrency: this.settings.maxRepoPermissionSyncJobConcurrency,
});
this.worker.on('completed', this.onJobCompleted.bind(this));
this.worker.on('failed', this.onJobFailed.bind(this));
Expand Down
20 changes: 20 additions & 0 deletions packages/schemas/src/v3/index.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ const schema = {
"type": "number",
"description": "The interval (in milliseconds) at which the user permission syncer should run. Defaults to 24 hours.",
"minimum": 1
},
"maxAccountPermissionSyncJobConcurrency": {
"type": "number",
"description": "The number of account permission sync jobs to run concurrently. Defaults to 8.",
"minimum": 1
},
"maxRepoPermissionSyncJobConcurrency": {
"type": "number",
"description": "The number of repo permission sync jobs to run concurrently. Defaults to 8.",
"minimum": 1
}
},
"additionalProperties": false
Expand Down Expand Up @@ -214,6 +224,16 @@ const schema = {
"type": "number",
"description": "The interval (in milliseconds) at which the user permission syncer should run. Defaults to 24 hours.",
"minimum": 1
},
"maxAccountPermissionSyncJobConcurrency": {
"type": "number",
"description": "The number of account permission sync jobs to run concurrently. Defaults to 8.",
"minimum": 1
},
"maxRepoPermissionSyncJobConcurrency": {
"type": "number",
"description": "The number of repo permission sync jobs to run concurrently. Defaults to 8.",
"minimum": 1
}
},
"additionalProperties": false
Expand Down
8 changes: 8 additions & 0 deletions packages/schemas/src/v3/index.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ export interface Settings {
* The interval (in milliseconds) at which the user permission syncer should run. Defaults to 24 hours.
*/
experiment_userDrivenPermissionSyncIntervalMs?: number;
/**
* The number of account permission sync jobs to run concurrently. Defaults to 8.
*/
maxAccountPermissionSyncJobConcurrency?: number;
/**
* The number of repo permission sync jobs to run concurrently. Defaults to 8.
*/
maxRepoPermissionSyncJobConcurrency?: number;
}
/**
* Search context
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ export const DEFAULT_CONFIG_SETTINGS: ConfigSettings = {
enablePublicAccess: false, // deprected, use FORCE_ENABLE_ANONYMOUS_ACCESS instead
experiment_repoDrivenPermissionSyncIntervalMs: 1000 * 60 * 60 * 24, // 24 hours
experiment_userDrivenPermissionSyncIntervalMs: 1000 * 60 * 60 * 24, // 24 hours
maxAccountPermissionSyncJobConcurrency: 8,
maxRepoPermissionSyncJobConcurrency: 8,
}
10 changes: 10 additions & 0 deletions schemas/v3/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@
"type": "number",
"description": "The interval (in milliseconds) at which the user permission syncer should run. Defaults to 24 hours.",
"minimum": 1
},
"maxAccountPermissionSyncJobConcurrency": {
"type": "number",
"description": "The number of account permission sync jobs to run concurrently. Defaults to 8.",
"minimum": 1
},
"maxRepoPermissionSyncJobConcurrency": {
"type": "number",
"description": "The number of repo permission sync jobs to run concurrently. Defaults to 8.",
"minimum": 1
}
},
"additionalProperties": false
Expand Down