Add some log to notification manager (#5546)

This commit is contained in:
Sheldon Guo 2024-10-29 18:38:59 +08:00 committed by GitHub
parent de31153aa4
commit 4bb9cdd141
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,13 +61,15 @@ export class NotificationManager implements NotificationManager {
return logData;
} catch (error) {
logData.status = 'failure';
logData.reason = error.reason;
this.plugin.logger.error('notification send failed', JSON.stringify(error));
logData.reason = JSON.stringify(error);
this.createSendingRecord(logData);
return logData;
}
}
async sendToUsers(options: SendUserOptions) {
const { userIds, channels, message, data } = options;
this.plugin.logger.info('notificationManager.sendToUsers options', JSON.stringify(options));
return await Promise.all(
channels.map((channelName) =>
this.send({ channelName, message, triggerFrom: 'sendToUsers', receivers: { value: userIds, type: 'userId' } }),