mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
fix: active platform
This commit is contained in:
@@ -38,6 +38,7 @@ export const platformModule = new Elysia({
|
||||
active: platform.active,
|
||||
})
|
||||
}
|
||||
console.log('platforms', platforms)
|
||||
})
|
||||
.get('/', async ({ query }) => {
|
||||
try {
|
||||
|
||||
@@ -136,9 +136,6 @@ export const updatePlatformConfig = async (id: string, config: Record<string, un
|
||||
// active
|
||||
|
||||
export const activePlatform = async (platform: Platform) => {
|
||||
if (platform.active) {
|
||||
return
|
||||
}
|
||||
await fetch(path.join(platform.endpoint, '/start'), {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(platform.config),
|
||||
@@ -149,9 +146,6 @@ export const activePlatform = async (platform: Platform) => {
|
||||
}
|
||||
|
||||
export const inactivePlatform = async (platform: Platform) => {
|
||||
if (!platform.active) {
|
||||
return
|
||||
}
|
||||
await fetch(path.join(platform.endpoint, '/stop'), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user