jbilcke-hf HF staff commited on
Commit
15081b3
·
1 Parent(s): 1bc6125

try 3 times to generate content

Browse files
Files changed (1) hide show
  1. src/production/renderPipeline.mts +12 -1
src/production/renderPipeline.mts CHANGED
@@ -19,7 +19,18 @@ export async function renderPipeline(request: RenderRequest, response: RenderedS
19
  } else {
20
  console.log(`rendering an image..`)
21
  }
22
- await renderContent(request, response)
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  // we upscale images with esrgan
25
  // and for videos, well.. let's just skip this part,
 
19
  } else {
20
  console.log(`rendering an image..`)
21
  }
22
+
23
+ try {
24
+ await renderContent(request, response)
25
+ } catch (err) {
26
+ console.log(`renderContent() failed, trying a 2nd time..`)
27
+ try {
28
+ await renderContent(request, response)
29
+ } catch (err2) {
30
+ console.log(`renderContent() failed, trying a 3th time..`)
31
+ await renderContent(request, response)
32
+ }
33
+ }
34
 
35
  // we upscale images with esrgan
36
  // and for videos, well.. let's just skip this part,