mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
15 lines
404 B
JavaScript
15 lines
404 B
JavaScript
// Define presences collection
|
|
Presences = new Mongo.Collection('presences');
|
|
|
|
if (Meteor.isServer) {
|
|
Meteor.startup(() => {
|
|
// Date of 7 days ago
|
|
let lastWeek = new Date();
|
|
lastWeek.setDate(lastWeek.getDate() - 7);
|
|
|
|
Presences.remove({ ttl: { $lte: lastWeek } });
|
|
|
|
// Create index for serverId that is queried often
|
|
Presences._collection._ensureIndex({ serverId: -1 });
|
|
});
|
|
}
|