Skip to content

Conversation

yaroslav8765
Copy link
Contributor

No description provided.

index.ts Outdated
this.totalDuration += (+new Date() - start) / 1000;

return resp.imageURLs[0]
setTimeout(async () => await this.generateImages(jobId, prompt, recordId, adminUser, headers), 100);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.generateImages(jobId, prompt, recordId, adminUser, headers)

const jobId = resp.jobId;
let jobStatus = null;
let jobResponse = null;
while (jobStatus !== 'completed' && jobStatus !== 'failed') {
Copy link
Contributor

@ivictbor ivictbor Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while jobStatus === 'inProgress'

index.ts Outdated

return resp.imageURLs[0]
setTimeout(async () => await this.generateImages(jobId, prompt, recordId, adminUser, headers), 100);
setTimeout(() => jobs.delete(jobId), 300_000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

increase to 30m

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add separate timeout which sets status to timed out after 5 minutes

method: 'POST',
body: { jobId },
});
if (jobResponse?.error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yaroslav8765 just interesting, now please try to disable network (in network tab switch offline) during job, what will be and what will be best option?

  • start generation
  • wait 15 sec
  • set offline mode
  • wait 15 sec
  • set online mode

will it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants