chore: rely on websockets for autosync if a websocket connection is open (#2672)

This commit is contained in:
Karol Sójko
2023-12-04 09:10:18 +01:00
committed by GitHub
parent 910f4a6388
commit 258422cf3c
12 changed files with 66 additions and 58 deletions

View File

@@ -1331,6 +1331,15 @@ export class Dependencies {
)
})
this.factory.set(TYPES.WebSocketsService, () => {
return new WebSocketsService(
this.get<DiskStorageService>(TYPES.DiskStorageService),
this.options.webSocketUrl,
this.get<WebSocketApiService>(TYPES.WebSocketApiService),
this.get<InternalEventBus>(TYPES.InternalEventBus),
)
})
this.factory.set(TYPES.SyncService, () => {
return new SyncService(
this.get<ItemManager>(TYPES.ItemManager),
@@ -1347,6 +1356,7 @@ export class Dependencies {
sleepBetweenBatches: this.options.sleepBetweenBatches,
},
this.get<Logger>(TYPES.Logger),
this.get<WebSocketsService>(TYPES.WebSocketsService),
this.get<InternalEventBus>(TYPES.InternalEventBus),
)
})
@@ -1390,15 +1400,6 @@ export class Dependencies {
)
})
this.factory.set(TYPES.WebSocketsService, () => {
return new WebSocketsService(
this.get<DiskStorageService>(TYPES.DiskStorageService),
this.options.webSocketUrl,
this.get<WebSocketApiService>(TYPES.WebSocketApiService),
this.get<InternalEventBus>(TYPES.InternalEventBus),
)
})
this.factory.set(TYPES.WebSocketApiService, () => {
return new WebSocketApiService(this.get<WebSocketServer>(TYPES.WebSocketServer))
})