mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Added sentry logging to member lookup for link clicks
no ref
This commit is contained in:
parent
0f9449137f
commit
a60756b321
2 changed files with 14 additions and 5 deletions
|
@ -59,11 +59,19 @@ module.exports = class LinkClickRepository {
|
|||
async save(linkClick) {
|
||||
let member;
|
||||
|
||||
if (config && config.get('linkClickTrackingCacheMemberUuid')) {
|
||||
member = await this.memoizedFindOne(linkClick.member_uuid);
|
||||
} else {
|
||||
member = await this.#Member.findOne({uuid: linkClick.member_uuid});
|
||||
}
|
||||
sentry.startSpan({name: 'Member.findOne'}, async () => {
|
||||
try {
|
||||
console.log(`finding member`);
|
||||
if (config && config.get('linkClickTrackingCacheMemberUuid')) {
|
||||
member = await this.memoizedFindOne(linkClick.member_uuid);
|
||||
} else {
|
||||
member = await this.#Member.findOne({uuid: linkClick.member_uuid});
|
||||
}
|
||||
} catch (error) {
|
||||
sentry.captureException(error);
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
||||
if (!member) {
|
||||
if (config.get('bulkEmail:captureLinkClickBadMemberUuid')) {
|
||||
|
|
|
@ -151,6 +151,7 @@ if (sentryConfig && !sentryConfig.disabled) {
|
|||
tracingHandler: Sentry.Handlers.tracingHandler(),
|
||||
captureException: Sentry.captureException,
|
||||
captureMessage: Sentry.captureMessage,
|
||||
startSpan: Sentry.startSpan,
|
||||
beforeSend: beforeSend,
|
||||
beforeSendTransaction: beforeSendTransaction,
|
||||
initQueryTracing: (knex) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue