Merge pull request #401 from LightningTipBot/dalle_timeout_increase

Dalle timeout increase
This commit is contained in:
calle 2022-08-30 19:55:32 +02:00 committed by GitHub
commit c21d42d1e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,7 +122,7 @@ func (bot *TipBot) generateDalleImages(event Event) {
return
}
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*3)
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*10)
defer cancel()
// generate a task to create an image with a prompt
task, err := dalleClient.Generate(ctx, invoiceEvent.CallbackData)
@ -133,7 +133,7 @@ func (bot *TipBot) generateDalleImages(event Event) {
}
// poll the task.ID until status is succeeded
var t *dalle.Task
timeout := time.After(90 * time.Second)
timeout := time.After(5 * time.Minute)
ticker := time.Tick(5 * time.Second)
// Keep trying until we're timed out or get a result/error
for {