MCPcopy Create free account
hub / github.com/Nynxz/ComfyUI-IdeogramHelper / queueJob

Function queueJob

web/main.js:2015–2028  ·  view source on GitHub ↗
(job)

Source from the content-addressed store, hash-verified

2013 return start;
2014}
2015function queueJob(job) {
2016 if (!(job.flags & 1)) {
2017 const jobId = getId(job);
2018 const lastJob = queue[queue.length - 1];
2019 if (!lastJob || // fast path when the job id is larger than the tail
2020 !(job.flags & 2) && jobId >= getId(lastJob)) {
2021 queue.push(job);
2022 } else {
2023 queue.splice(findInsertionIndex(jobId), 0, job);
2024 }
2025 job.flags |= 1;
2026 queueFlush();
2027 }
2028}
2029function queueFlush() {
2030 if (!currentFlushPromise) {
2031 currentFlushPromise = resolvedPromise.then(flushJobs);

Callers 3

doWatchFunction · 0.85
main.jsFile · 0.85
setupRenderEffectFunction · 0.85

Calls 3

getIdFunction · 0.85
findInsertionIndexFunction · 0.85
queueFlushFunction · 0.85

Tested by

no test coverage detected