fix(syncing-server): add debug logs about sending items changed event
This commit is contained in:
parent
d0d4bd23fb
commit
2d6a3ebf45
2 changed files with 4 additions and 0 deletions
|
@ -81,6 +81,7 @@ describe('SaveItems', () => {
|
|||
updateExistingItem.execute = jest.fn().mockResolvedValue(Result.ok(savedItem))
|
||||
|
||||
logger = {} as jest.Mocked<Logger>
|
||||
logger.debug = jest.fn()
|
||||
logger.error = jest.fn()
|
||||
|
||||
itemHash1 = ItemHash.create({
|
||||
|
|
|
@ -160,8 +160,11 @@ export class SaveItems implements UseCaseInterface<SaveItemsResult> {
|
|||
const tenPercentSpreadArray = Array.from(Array(10).keys())
|
||||
const diceRoll = this.deterministicSelector.select(dto.userUuid, tenPercentSpreadArray)
|
||||
if (diceRoll !== 1) {
|
||||
this.logger.debug(`[${dto.userUuid}] Not sending items changed event to client.`)
|
||||
|
||||
return
|
||||
}
|
||||
this.logger.debug(`[${dto.userUuid}] Sending items changed event to client.`)
|
||||
|
||||
const itemsChangedEvent = this.domainEventFactory.createItemsChangedOnServerEvent({
|
||||
userUuid: dto.userUuid,
|
||||
|
|
Loading…
Reference in a new issue