Coordinate shared GPU access across studio instances
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
import { withSharedGpuReset } from '~/server/utils/sharedGpu'
|
||||
import { libraryOwnerKey } from '~/server/utils/library'
|
||||
import { requestComfyForceReset } from '~/server/utils/comfyLifecycle'
|
||||
import { clearStuckStudioWork } from '~/server/utils/studioQueue'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const owner = libraryOwnerKey(event)
|
||||
const cleared = await clearStuckStudioWork(owner)
|
||||
const comfy = await requestComfyForceReset()
|
||||
return {
|
||||
ok: true,
|
||||
message: 'Cleared every stuck Studio/music/shot job and force-stopped Comfy. Use Wake / Poke when you want the GPU again.',
|
||||
cleared,
|
||||
comfy
|
||||
}
|
||||
return withSharedGpuReset(async () => {
|
||||
const cleared = await clearStuckStudioWork(owner)
|
||||
const comfy = await requestComfyForceReset()
|
||||
return {
|
||||
ok: true,
|
||||
message: 'Cleared every stuck Studio/music/shot job and force-stopped Comfy. Use Wake / Poke when you want the GPU again.',
|
||||
cleared,
|
||||
comfy
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user