refactor(streaming): bump default timeout

There's no point trying to argue with people who rely on
faulty behaviour and race conditions.
This commit is contained in:
Linden
2024-04-18 01:26:32 +10:00
parent 3fc84398f6
commit fb5bd87dc2
7 changed files with 7 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
---Load an animation dictionary. When called from a thread, it will yield until it has loaded. ---Load an animation dictionary. When called from a thread, it will yield until it has loaded.
---@param animDict string ---@param animDict string
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 1000. ---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 10000.
---@return string animDict ---@return string animDict
function lib.requestAnimDict(animDict, timeout) function lib.requestAnimDict(animDict, timeout)
if HasAnimDictLoaded(animDict) then return animDict end if HasAnimDictLoaded(animDict) then return animDict end

View File

@@ -1,6 +1,6 @@
---Load an animation clipset. When called from a thread, it will yield until it has loaded. ---Load an animation clipset. When called from a thread, it will yield until it has loaded.
---@param animSet string ---@param animSet string
---@param timeout number? Approximate milliseconds to wait for the clipset to load. Default is 1000. ---@param timeout number? Approximate milliseconds to wait for the clipset to load. Default is 10000.
---@return string animSet ---@return string animSet
function lib.requestAnimSet(animSet, timeout) function lib.requestAnimSet(animSet, timeout)
if HasAnimSetLoaded(animSet) then return animSet end if HasAnimSetLoaded(animSet) then return animSet end

View File

@@ -1,6 +1,6 @@
---Load a model. When called from a thread, it will yield until it has loaded. ---Load a model. When called from a thread, it will yield until it has loaded.
---@param model number | string ---@param model number | string
---@param timeout number? Approximate milliseconds to wait for the model to load. Default is 1000. ---@param timeout number? Approximate milliseconds to wait for the model to load. Default is 10000.
---@return number model ---@return number model
function lib.requestModel(model, timeout) function lib.requestModel(model, timeout)
if type(model) ~= 'number' then model = joaat(model) end if type(model) ~= 'number' then model = joaat(model) end

View File

@@ -1,6 +1,6 @@
---Load a named particle effect. When called from a thread, it will yield until it has loaded. ---Load a named particle effect. When called from a thread, it will yield until it has loaded.
---@param ptFxName string ---@param ptFxName string
---@param timeout number? Approximate milliseconds to wait for the particle effect to load. Default is 1000. ---@param timeout number? Approximate milliseconds to wait for the particle effect to load. Default is 10000.
---@return string ptFxName ---@return string ptFxName
function lib.requestNamedPtfxAsset(ptFxName, timeout) function lib.requestNamedPtfxAsset(ptFxName, timeout)
if HasNamedPtfxAssetLoaded(ptFxName) then return ptFxName end if HasNamedPtfxAssetLoaded(ptFxName) then return ptFxName end

View File

@@ -1,6 +1,6 @@
---Load a texture dictionary. When called from a thread, it will yield until it has loaded. ---Load a texture dictionary. When called from a thread, it will yield until it has loaded.
---@param textureDict string ---@param textureDict string
---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 1000. ---@param timeout number? Approximate milliseconds to wait for the dictionary to load. Default is 10000.
---@return string textureDict ---@return string textureDict
function lib.requestStreamedTextureDict(textureDict, timeout) function lib.requestStreamedTextureDict(textureDict, timeout)
if HasStreamedTextureDictLoaded(textureDict) then return textureDict end if HasStreamedTextureDictLoaded(textureDict) then return textureDict end

View File

@@ -17,7 +17,7 @@
---Load a weapon asset. When called from a thread, it will yield until it has loaded. ---Load a weapon asset. When called from a thread, it will yield until it has loaded.
---@param weaponType string | number ---@param weaponType string | number
---@param timeout number? Approximate milliseconds to wait for the asset to load. Default is 1000. ---@param timeout number? Approximate milliseconds to wait for the asset to load. Default is 10000.
---@param weaponResourceFlags WeaponResourceFlags? Default is 31. ---@param weaponResourceFlags WeaponResourceFlags? Default is 31.
---@param extraWeaponComponentFlags ExtraWeaponComponentFlags? Default is 0. ---@param extraWeaponComponentFlags ExtraWeaponComponentFlags? Default is 0.
---@return string | number weaponType ---@return string | number weaponType

View File

@@ -18,7 +18,7 @@ function lib.streamingRequest(request, hasLoaded, assetType, asset, timeout, ...
return lib.waitFor(function() return lib.waitFor(function()
if hasLoaded(asset) then return asset end if hasLoaded(asset) then return asset end
end, ("failed to load %s '%s' - this is likely caused by unreleased assets"):format(assetType, asset), timeout) end, ("failed to load %s '%s' - this is likely caused by unreleased assets"):format(assetType, asset), timeout or 10000)
end end
return lib.streamingRequest return lib.streamingRequest