Remove old session data

This commit is contained in:
John R. Supplee 2021-01-25 16:12:33 +02:00
parent 20ab2f039b
commit f2e7296d19

View file

@ -547,7 +547,19 @@ Meteor.publish('globalSearch', function(sessionId, queryParams) {
}); });
} }
SessionData.upsert({ userId: this.userId, sessionId }, update); SessionData.upsert({ userId, sessionId }, update);
// remove old session data
SessionData.remove({
userId,
modifiedAt: {
$lt: new Date(
moment()
.subtract(1, 'day')
.format(),
),
},
});
if (cards) { if (cards) {
const boards = []; const boards = [];