Skip to content

If the WebSocket connection is interrupted and then restored, how can I retrieve the job instance again? #4

@1021683053

Description

@1021683053
const job = await api.run(wf, { autoDestroy: true });

job
  .on('pending', id => console.log('[queue]', id))
  .on('start', id => console.log('[start]', id))
  .on('progress_pct', pct => process.stdout.write(`\rprogress ${pct}%   `))
  .on('preview', blob => console.log('\npreview frame bytes=', blob.size))
  .on('failed', err => console.error('\nerror', err));

const result = await job.done(); // or simply: await job

I want to store the job execution results, regardless of whether the job succeeds or fails.
Since the service and ComfyUI are not on the same server, connection interruptions may occur.
After a disconnection, the job might have already completed successfully, failed, or still be running.
When reconnecting, I want to retrieve the job instance again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions