Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(streaming): Add 5000ms delay to ox_lib streaming requests #14

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

jnccloud
Copy link
Contributor

@jnccloud jnccloud commented Jan 12, 2024

Description

Adjusts default timeout to 5s instead of the default from ox_lib. Some assets don't load in time and break scripts due to this. I would imagine worse for add-on assets. I also do not believe the default in ox_lib is working as intended.

Example from qbx_jewelry:
image

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

@solareon
Copy link
Contributor

Is there a reason that default timeout of 500 is not enough?

@jnccloud
Copy link
Contributor Author

Is there a reason that default timeout of 500 is not enough?

Its stemmed from this topic https://discord.com/channels/1012753553418354748/1192610368195932170

But it has caused issues for players with less than ideal setups. Especially add-on assets seem to make this worse. But the most common occurrence has been in qbx_jewelry loading particle effects. I had realized I already increased to 5s on my fork of newsjob so was just pushing it upstream.

@jnccloud
Copy link
Contributor Author

Added more details to the description and a pic of why I made this PR.

@BerkieBb
Copy link
Contributor

Well the reason it fails to load in time is really because it's either badly optimized or your pc is slower, but this can be adjusted to accomodate for both

@jnccloud
Copy link
Contributor Author

Well the reason it fails to load in time is really because it's either badly optimized or your pc is slower, but this can be adjusted to accomodate for both

I agree this user may have a slower PC but that shouldn't break a script. In the cases I've seen this happen (as you can see in the screenshot) - ox_lib only waited for 6ms. Its vanilla up to date code in these instances, so it doesn't make sense to me why ox didn't wait the default 500ms

@BerkieBb
Copy link
Contributor

Well the reason it fails to load in time is really because it's either badly optimized or your pc is slower, but this can be adjusted to accomodate for both

I agree this user may have a slower PC but that shouldn't break a script. In the cases I've seen this happen (as you can see in the screenshot) - ox_lib only waited for 6ms. Its vanilla up to date code in these instances, so it doesn't make sense to me why ox didn't wait the default 500ms

It didn't wait 500ms because of how the timeout is made, the timeout counts up on every tick and a tick can be faster than 1 ms.

@ChatDisabled ChatDisabled merged commit 20de24d into Qbox-project:main Jan 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants