fix(api): wait for modules readiness before starting server (#752)

This commit is contained in:
Julien Neuhart
2023-12-13 14:37:35 +01:00
committed by GitHub
parent 4bd7cba247
commit cc65ca9b6a
16 changed files with 370 additions and 138 deletions

View File

@@ -304,12 +304,11 @@ func waitForExpressionBeforePrintActionFunc(logger *zap.Logger, disableJavaScrip
select {
case <-ctx.Done():
ticker.Stop()
return fmt.Errorf("context done while evaluating '%s': %w", expression, ctx.Err())
case <-ticker.C:
var ok bool
evaluate := chromedp.Evaluate(expression, &ok)
err := evaluate.Do(ctx)
if err != nil {
return fmt.Errorf("evaluate: %v: %w", err, ErrInvalidEvaluationExpression)
@@ -317,7 +316,6 @@ func waitForExpressionBeforePrintActionFunc(logger *zap.Logger, disableJavaScrip
if ok {
ticker.Stop()
return nil
}