mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
feat: platform connection error handle
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user