Skip to content

CallWrapper will just exist indefinitely if Job is removed #9

@btaens

Description

@btaens

There seems to be currently no check back for the CallWrapper whether the enqueued job still even exists.
This results in if something from outside the call wrapper process changing the queue, removing the prompt in question, CallWrapper will just keep existing and waiting indefinitely, potentially causing an ever increasing number of callwrappers taking up memory, with the closest triggering event being a complete disconnection from ComfyUI.

It should trigger the Failed callback if the job is no longer in the queue, with it's own error class to be able to distinguish it. This could be achieved by hooking into the Client class' already existing on('status') method, which triggers every time the queue changes. At this point the promptId could be checked against the result of getQueue()'s running and pending jobs.

A bit off topic, but a method should probably also be implemented on Client for deleting queue items, and history items (probably based on promptId because of how the SDK works.). This is not critical though, as it can be implemented with the fetchApi method, though probably makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions