fix: logs stops listening after 1st of multiple queue tasks

This commit is contained in:
bymyself
2025-06-23 05:29:50 -07:00
committed by Jin Yi
parent b7c8180eb3
commit ee7d07a0cd
2 changed files with 6 additions and 4 deletions

View File

@@ -93,7 +93,9 @@ export const useServerLogs = (options: UseServerLogsOptions) => {
stopLogs = null
stopTaskStarted = null
stopTaskDone = null
await api.subscribeLogs(false)
// TODO: move subscribe/unsubscribe logs to useManagerQueue. Subscribe when task starts if not already subscribed.
// Unsubscribe ONLY when there are no tasks running or queued up and the only remaining task finishes.
// await api.subscribeLogs(false)
}
if (immediate) {

View File

@@ -178,8 +178,9 @@ export const useComfyManagerStore = defineStore('comfyManager', () => {
taskName: string
) => {
const taskId = uuidv4()
const { startListening, logs } = useServerLogs({
ui_id: taskId
const { logs } = useServerLogs({
ui_id: taskId,
immediate: true
})
try {
@@ -189,7 +190,6 @@ export const useComfyManagerStore = defineStore('comfyManager', () => {
// Prepare logging hook
taskLogs.value.push({ taskName, taskId, logs: logs.value })
await startListening()
// Queue the task to the server
await task(taskId)