mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
Added extra logging to collections event processing
no issue - These logs are useful when tracking event processing by the collections repo.
This commit is contained in:
parent
382d7fa25f
commit
0be06f0237
1 changed files with 4 additions and 0 deletions
|
@ -156,18 +156,22 @@ export class CollectionsService {
|
||||||
// generic handler for all events that are not handled optimally yet
|
// generic handler for all events that are not handled optimally yet
|
||||||
// this handler should go away once we have logic fo reach event
|
// this handler should go away once we have logic fo reach event
|
||||||
this.DomainEvents.subscribe(CollectionResourceChangeEvent, async () => {
|
this.DomainEvents.subscribe(CollectionResourceChangeEvent, async () => {
|
||||||
|
logging.info('CollectionResourceChangeEvent received, updating all collections');
|
||||||
await this.updateCollections();
|
await this.updateCollections();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.DomainEvents.subscribe(PostDeletedEvent, async (event: PostDeletedEvent) => {
|
this.DomainEvents.subscribe(PostDeletedEvent, async (event: PostDeletedEvent) => {
|
||||||
|
logging.info(`PostDeletedEvent received, removing post ${event.id} from all collections`);
|
||||||
await this.removePostFromAllCollections(event.id);
|
await this.removePostFromAllCollections(event.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.DomainEvents.subscribe(PostAddedEvent, async (event: PostAddedEvent) => {
|
this.DomainEvents.subscribe(PostAddedEvent, async (event: PostAddedEvent) => {
|
||||||
|
logging.info(`PostAddedEvent received, adding post ${event.data.id} to matching collections`);
|
||||||
await this.addPostToMatchingCollections(event.data);
|
await this.addPostToMatchingCollections(event.data);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.DomainEvents.subscribe(PostEditedEvent, async (event: PostEditedEvent) => {
|
this.DomainEvents.subscribe(PostEditedEvent, async (event: PostEditedEvent) => {
|
||||||
|
logging.info(`PostEditedEvent received, updating post ${event.data.id} in matching collections`);
|
||||||
await this.updatePostInMatchingCollections(event.data);
|
await this.updatePostInMatchingCollections(event.data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue