mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
서버 코드를 Router, Service, Repository 계층으로 분리하고 오류 처리 및 파일 삭제 로직 개선
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ed732be999
commit
6a6aa1765b
72 files changed
+1928
-1509
No files matched your search
+8
-10
@@ -1,23 +1,21 @@
|
||||
import { sequence, type ServerInit } from "@sveltejs/kit/hooks";
|
||||
import schedule from "node-schedule";
|
||||
import { cleanupExpiredUserClientChallenges } from "#lib/server/db/client.js";
|
||||
import { ClientRepo, SessionRepo } from "#lib/server/db/index.js";
|
||||
import { migrateDB } from "#lib/server/db/kysely.js";
|
||||
import {
|
||||
cleanupExpiredSessions,
|
||||
cleanupExpiredSessionUpgradeChallenges,
|
||||
} from "#lib/server/db/session.js";
|
||||
import { authenticate, setAgentInfo } from "#lib/server/middlewares/index.js";
|
||||
import { cleanupExpiredUploadSessions } from "#lib/server/services/upload.js";
|
||||
import { FileDeletionService, UploadService } from "#lib/server/services/index.js";
|
||||
|
||||
export const init: ServerInit = async () => {
|
||||
await migrateDB();
|
||||
|
||||
schedule.scheduleJob("0 * * * *", () => {
|
||||
cleanupExpiredUserClientChallenges();
|
||||
cleanupExpiredSessions();
|
||||
cleanupExpiredSessionUpgradeChallenges();
|
||||
cleanupExpiredUploadSessions();
|
||||
ClientRepo.cleanupExpiredUserClientChallenges();
|
||||
SessionRepo.cleanupExpiredSessions();
|
||||
SessionRepo.cleanupExpiredSessionUpgradeChallenges();
|
||||
UploadService.cleanupExpiredUploadSessions();
|
||||
FileDeletionService.schedulePendingFileDeletions();
|
||||
});
|
||||
FileDeletionService.schedulePendingFileDeletions();
|
||||
};
|
||||
|
||||
export const handle = sequence(setAgentInfo, authenticate);
|
||||
Reference in new issue
Block a user