mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
fix(worker): Fix issue where connections would always sync on startup (#613)
Some checks failed
Publish to ghcr / build (linux/amd64, blacksmith-4vcpu-ubuntu-2404) (push) Has been cancelled
Publish to ghcr / build (linux/arm64, blacksmith-8vcpu-ubuntu-2204-arm) (push) Has been cancelled
Update Roadmap Released / update (push) Has been cancelled
Publish to ghcr / merge (push) Has been cancelled
Some checks failed
Publish to ghcr / build (linux/amd64, blacksmith-4vcpu-ubuntu-2404) (push) Has been cancelled
Publish to ghcr / build (linux/arm64, blacksmith-8vcpu-ubuntu-2204-arm) (push) Has been cancelled
Update Roadmap Released / update (push) Has been cancelled
Publish to ghcr / merge (push) Has been cancelled
This commit is contained in:
parent
903d15a2c5
commit
06c84f0bf5
4 changed files with 6 additions and 2 deletions
|
|
@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Fixed incorrect shutdown of PostHog SDK in the worker. [#609](https://github.com/sourcebot-dev/sourcebot/pull/609)
|
- Fixed incorrect shutdown of PostHog SDK in the worker. [#609](https://github.com/sourcebot-dev/sourcebot/pull/609)
|
||||||
- Fixed race condition in job schedulers. [#607](https://github.com/sourcebot-dev/sourcebot/pull/607)
|
- Fixed race condition in job schedulers. [#607](https://github.com/sourcebot-dev/sourcebot/pull/607)
|
||||||
- Fixed connection sync jobs getting stuck in pending or in progress after restarting the worker. [#612](https://github.com/sourcebot-dev/sourcebot/pull/612)
|
- Fixed connection sync jobs getting stuck in pending or in progress after restarting the worker. [#612](https://github.com/sourcebot-dev/sourcebot/pull/612)
|
||||||
|
- Fixed issue where connections would always sync on startup, regardless if they changed or not. [#613](https://github.com/sourcebot-dev/sourcebot/pull/613)
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Added force resync buttons for connections and repositories. [#610](https://github.com/sourcebot-dev/sourcebot/pull/610)
|
- Added force resync buttons for connections and repositories. [#610](https://github.com/sourcebot-dev/sourcebot/pull/610)
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@
|
||||||
"dotenv": "^16.4.5",
|
"dotenv": "^16.4.5",
|
||||||
"express": "^4.21.2",
|
"express": "^4.21.2",
|
||||||
"express-async-errors": "^3.1.1",
|
"express-async-errors": "^3.1.1",
|
||||||
|
"fast-deep-equal": "^3.1.3",
|
||||||
"git-url-parse": "^16.1.0",
|
"git-url-parse": "^16.1.0",
|
||||||
"gitea-js": "^1.22.0",
|
"gitea-js": "^1.22.0",
|
||||||
"glob": "^11.0.0",
|
"glob": "^11.0.0",
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import chokidar, { FSWatcher } from 'chokidar';
|
||||||
import { ConnectionManager } from "./connectionManager.js";
|
import { ConnectionManager } from "./connectionManager.js";
|
||||||
import { SINGLE_TENANT_ORG_ID } from "./constants.js";
|
import { SINGLE_TENANT_ORG_ID } from "./constants.js";
|
||||||
import { syncSearchContexts } from "./ee/syncSearchContexts.js";
|
import { syncSearchContexts } from "./ee/syncSearchContexts.js";
|
||||||
|
import isEqual from 'fast-deep-equal';
|
||||||
|
|
||||||
const logger = createLogger('config-manager');
|
const logger = createLogger('config-manager');
|
||||||
|
|
||||||
|
|
@ -64,8 +65,8 @@ export class ConfigManager {
|
||||||
|
|
||||||
const existingConnectionConfig = existingConnection ? existingConnection.config as unknown as ConnectionConfig : undefined;
|
const existingConnectionConfig = existingConnection ? existingConnection.config as unknown as ConnectionConfig : undefined;
|
||||||
const connectionNeedsSyncing =
|
const connectionNeedsSyncing =
|
||||||
!existingConnection ||
|
!existingConnectionConfig ||
|
||||||
(JSON.stringify(existingConnectionConfig) !== JSON.stringify(newConnectionConfig));
|
!isEqual(existingConnectionConfig, newConnectionConfig);
|
||||||
|
|
||||||
// Either update the existing connection or create a new one.
|
// Either update the existing connection or create a new one.
|
||||||
const connection = existingConnection ?
|
const connection = existingConnection ?
|
||||||
|
|
|
||||||
|
|
@ -7909,6 +7909,7 @@ __metadata:
|
||||||
dotenv: "npm:^16.4.5"
|
dotenv: "npm:^16.4.5"
|
||||||
express: "npm:^4.21.2"
|
express: "npm:^4.21.2"
|
||||||
express-async-errors: "npm:^3.1.1"
|
express-async-errors: "npm:^3.1.1"
|
||||||
|
fast-deep-equal: "npm:^3.1.3"
|
||||||
git-url-parse: "npm:^16.1.0"
|
git-url-parse: "npm:^16.1.0"
|
||||||
gitea-js: "npm:^1.22.0"
|
gitea-js: "npm:^1.22.0"
|
||||||
glob: "npm:^11.0.0"
|
glob: "npm:^11.0.0"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue