-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement job architecture for image generation #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
index.ts
Outdated
this.totalDuration += (+new Date() - start) / 1000; | ||
|
||
return resp.imageURLs[0] | ||
setTimeout(async () => await this.generateImages(jobId, prompt, recordId, adminUser, headers), 100); |
There was a problem hiding this comment.
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)
custom/imageGenerator.vue
Outdated
const jobId = resp.jobId; | ||
let jobStatus = null; | ||
let jobResponse = null; | ||
while (jobStatus !== 'completed' && jobStatus !== 'failed') { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
increase to 30m
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
No description provided.