Skip to content

Commit

Permalink
Merge pull request #1395 from WideChat/inactive_sns
Browse files Browse the repository at this point in the history
[NEW] Add SNS logs to inactive rooms monitor
  • Loading branch information
ear-dev authored Sep 6, 2023
2 parents 8e7b6cb + cbf9281 commit e1771b0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps/meteor/app/livechat/server/lib/InactiveRoomsMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { SyncedCron } from 'meteor/littledata:synced-cron';
import { Logger } from '../../../logger/server';
import { Livechat } from './Livechat';
import { Users, LivechatRooms } from '../../../models/server';
import { SNS } from './SNS';
import { settings } from '../../../settings/server';

const logger = new Logger('InactiveRoomsMonitor');
Expand Down Expand Up @@ -64,6 +65,16 @@ export class InactiveRoomsMonitor {
rooms?.forEach((room: any) => {
logger.info('Closing inactive room: ', room._id);
Livechat.closeRoom({ comment: this._closeComment, room, user: this._user, visitor: null });
SNS.sendEvent({
roomId: room._id,
category: 'Chat Session',
action: 'closed',
eventType: 'session',
timestamp: new Date().toISOString(),
properties: {
close_method: 'visitor_abandonment',
},
});
});
}
}

0 comments on commit e1771b0

Please sign in to comment.