Skip to content

Commit

Permalink
Backported timeout issue fix from 1.0.0 dev branch. PREVIEW2-RC2
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroRauizBeamable committed Sep 5, 2024
1 parent 0f551b3 commit 020fb0f
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,13 @@ TUnrealRequestPtr UBeamBackend::CreateUnpreparedRequest(int64& OutRequestId, con
// Creates a request with the specified timeout.
auto Req = FHttpModule::Get().CreateRequest();
Req->SetTimeout(RetryConfig.Timeout);
Req->SetHeader(FString(TEXT("X-BEAM-TIMEOUT")), FString::Printf(TEXT("%lld"),RetryConfig.Timeout));
// Set the timeout header so that Beamable's Gateway itself knows how long
const auto TimeoutInMilliseconds = RetryConfig.Timeout * 1000;
// the value should not be lower than 10_000
if (TimeoutInMilliseconds >= 10000)
{
Req->SetHeader(FString(TEXT("X-BEAM-TIMEOUT")), FString::Printf(TEXT("%lld"), TimeoutInMilliseconds));
}
Req->SetHeader(TEXT("X-KS-USER-AGENT"), FString::Printf(TEXT("Unreal-%s"), *UGameplayStatics::GetPlatformName()));

UE_LOG(LogBeamBackend, Verbose, TEXT("Request Preparation: TIMEOUT_HEADER=%lld"), RetryConfig.Timeout);
Expand Down

0 comments on commit 020fb0f

Please sign in to comment.