mirror of
https://github.com/xtr-dev/rondevu-server.git
synced 2025-12-10 10:53:24 +00:00
Fix TypeScript error: use cleanupExpiredSessions() method
- Replace direct db access with the public cleanupExpiredSessions() method - This fixes the TS2341 error about private property access - Also improves logging to show count of deleted sessions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -48,13 +48,10 @@ export default {
|
|||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Delete expired sessions
|
// Delete expired sessions using the storage method
|
||||||
await storage.db
|
const deletedCount = await storage.cleanupExpiredSessions();
|
||||||
.prepare('DELETE FROM sessions WHERE expires_at < ?')
|
|
||||||
.bind(now)
|
|
||||||
.run();
|
|
||||||
|
|
||||||
console.log(`Cleaned up expired sessions at ${new Date(now).toISOString()}`);
|
console.log(`Cleaned up ${deletedCount} expired sessions at ${new Date(now).toISOString()}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error cleaning up sessions:', error);
|
console.error('Error cleaning up sessions:', error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user