mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-14 22:43:57 +00:00
use deleteMany and $in instead of deleteOne to delete expired sessions
Change-Id: I00462df4a3943f4b631160ccf721b6db730b0eff
This commit is contained in:
1 parent
12bee93c99
commit
eeeac6bce2
1 file changed
+2
-1
+2
-1
@@ -42,7 +42,8 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
Util.addToValueSet(sessionsByCacheName, cacheName, session);
|
||||
}
|
||||
});
|
||||
expiredSessionIds.forEach(id->sessionsCollection.deleteOne(new Document(FieldNames.SESSION_ID.name(), id)));
|
||||
final Document filter = new Document("$in", Util.map(expiredSessionIds, id->id.toString()));
|
||||
sessionsCollection.deleteMany(new Document(FieldNames.SESSION_ID.name(), filter));
|
||||
return sessionsByCacheName;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user