feat: platform connection error handle

This commit is contained in:
Acbox
2026-01-12 20:33:20 +08:00
parent 7f5866298f
commit 1f1d6392fa
2 changed files with 18 additions and 11 deletions
+13 -10
View File
@@ -28,17 +28,20 @@ export const platformModule = new Elysia({
.use(optionalAuthMiddleware)
// Get all platforms
.onStart(async () => {
const platforms = await getActivePlatforms()
for (const platform of platforms) {
await activePlatform({
id: platform.id,
name: platform.name,
endpoint: platform.endpoint,
config: platform.config as Record<string, unknown>,
active: platform.active,
})
try {
const platforms = await getActivePlatforms()
for (const platform of platforms) {
await activePlatform({
id: platform.id,
name: platform.name,
endpoint: platform.endpoint,
config: platform.config as Record<string, unknown>,
active: platform.active,
})
}
} catch (error) {
console.error('Failed to start platform', error)
}
console.log('platforms', platforms)
})
.get('/', async ({ query }) => {
try {
+5 -1
View File
@@ -22,7 +22,11 @@ export const scheduleModule = new Elysia({ prefix: '/schedule' })
.use(authMiddleware)
// Get all schedules for current user
.onStart(async () => {
await resume()
try {
await resume()
} catch (error) {
console.error('Failed to resume schedule', error)
}
})
.get('/', async ({ user, query }) => {
try {