From 0be06f023785fd750da8746cb5a744e2b718640d Mon Sep 17 00:00:00 2001 From: Naz Date: Fri, 14 Jul 2023 14:09:54 +0800 Subject: [PATCH] Added extra logging to collections event processing no issue - These logs are useful when tracking event processing by the collections repo. --- ghost/collections/src/CollectionsService.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ghost/collections/src/CollectionsService.ts b/ghost/collections/src/CollectionsService.ts index 7811de34db..6a9c7dfb66 100644 --- a/ghost/collections/src/CollectionsService.ts +++ b/ghost/collections/src/CollectionsService.ts @@ -156,18 +156,22 @@ export class CollectionsService { // generic handler for all events that are not handled optimally yet // this handler should go away once we have logic fo reach event this.DomainEvents.subscribe(CollectionResourceChangeEvent, async () => { + logging.info('CollectionResourceChangeEvent received, updating all collections'); await this.updateCollections(); }); this.DomainEvents.subscribe(PostDeletedEvent, async (event: PostDeletedEvent) => { + logging.info(`PostDeletedEvent received, removing post ${event.id} from all collections`); await this.removePostFromAllCollections(event.id); }); this.DomainEvents.subscribe(PostAddedEvent, async (event: PostAddedEvent) => { + logging.info(`PostAddedEvent received, adding post ${event.data.id} to matching collections`); await this.addPostToMatchingCollections(event.data); }); this.DomainEvents.subscribe(PostEditedEvent, async (event: PostEditedEvent) => { + logging.info(`PostEditedEvent received, updating post ${event.data.id} in matching collections`); await this.updatePostInMatchingCollections(event.data); }); }