Skip to content

Commit

Permalink
Fix LT-21713: Clear the error status during cold start retry
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonleenaylor committed Apr 29, 2024
1 parent 3fdca2b commit c9f0c9c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Src/xWorks/UploadToWebonaryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ private bool RecursivelyPutFilesToWebonary(UploadToWebonaryModel model, string d
var signedUrl = PostContentToWebonary(model, webonaryView, "post/file", fileToSign);
if (string.IsNullOrEmpty(signedUrl))
{
webonaryView.SetStatusCondition(WebonaryStatusCondition.None);
webonaryView.UpdateStatus(xWorksStrings.UploadToWebonaryController_RetryAfterFailedConnection);
// Sleep briefly and try one more time (To compensate for a potential lambda cold start)
Thread.Sleep(500);
signedUrl = PostContentToWebonary(model, webonaryView, "post/file", fileToSign);
Expand Down
11 changes: 10 additions & 1 deletion Src/xWorks/xWorksStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Src/xWorks/xWorksStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1259,4 +1259,7 @@ See USFM documentation for help.</value>
<data name="Webonary_UnexpectedUploadError" xml:space="preserve">
<value>Unexpected error encountered while uploading to webonary.</value>
</data>
<data name="UploadToWebonaryController_RetryAfterFailedConnection" xml:space="preserve">
<value>Initial connection failed retrying...</value>
</data>
</root>

0 comments on commit c9f0c9c

Please sign in to comment.