CesiumGS / cesium-unreal

Bringing the 3D geospatial ecosystem to Unreal Engine
https://cesium.com/platform/cesium-for-unreal/
Apache License 2.0
959 stars 297 forks source link

When exiting PIE, the editor gets stuck for a long time #1523

Open kak0na opened 2 months ago

kak0na commented 2 months ago

When exiting PIE, the editor will be stuck for a long time. It is a problem with requesting data. We can only add a timeout, but we don’t know if it is correct. Do you think we should add this judgment?

https://www.bilibili.com/video/BV1e7WBeEERR

UnrealAssetAccessor.cpp

return asyncSystem.createFuture<std::shared_ptr>( [&url, &headers, &userAgent, &cesiumRequestHeaders](const auto& promise) { FHttpModule& httpModule = FHttpModule::Get(); TSharedRef<IHttpRequest, ESPMode::ThreadSafe> pRequest = httpModule.CreateRequest(); pRequest->SetURL(UTF8_TO_TCHAR(url.c_str()));

    pRequest->SetTimeout(10);

    for (const auto& header : headers) {
      pRequest->SetHeader(
          UTF8_TO_TCHAR(header.first.c_str()),
          UTF8_TO_TCHAR(header.second.c_str()));
    }
kring commented 2 months ago

Adding a timeout is ok, but it's probably better to figure out why the server is taking so long to respond to some requests in your case. That's most likely the root of the issue here.