Skip to content

Commit 742c50f

Browse files
committed
session cleanup
1 parent f8f4467 commit 742c50f

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# GameVault Backend Server Changelog
22

3+
## 16.1.3
4+
5+
### Changes
6+
7+
- Fixed Session Cleanup Algorithm failing to work on large servers.
8+
39
## 16.1.2
410

511
### Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gamevault-backend",
3-
"version": "16.1.2",
3+
"version": "16.1.3",
44
"description": "the self-hosted gaming platform for drm-free games",
55
"author": "Alkan Alper, Schäfer Philip GbR / Phalcode",
66
"private": true,

src/modules/auth/authentication.service.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,13 @@ export class AuthenticationService implements OnModuleInit {
3838
);
3939
const cutoffDate = new Date(Date.now() - expiryTime * 3);
4040

41-
const result = await this.sessionRepository.remove(
42-
await this.sessionRepository.find({
43-
where: {
44-
expires_at: LessThan(cutoffDate),
45-
},
46-
}),
47-
);
41+
const result = await this.sessionRepository.delete({
42+
expires_at: LessThan(cutoffDate),
43+
});
4844

4945
this.logger.debug({
5046
message: "Cleaned up expired sessions",
51-
deletedCount: result.length,
47+
deletedCount: result.affected,
5248
cutoffDate,
5349
expiryTime,
5450
});

0 commit comments

Comments
 (0)