The SparkHTTP timeout isn't strictly defined but does adhere to the timeout of script executions on the platform, which is approx 30 seconds.
-Pádraig
D
Dylan Hunt
said
over 3 years ago
How to explicitly define it? 30s for an HTTP timeout means your entire call will timeout with 0 error info even for a simple ping/pong request, if the other side times out.
Surely there must be a way? For example, right now, our entire game is offline while I skip a simple ping/pong request while our server is down.
Even then, the default *should* be explicitly defined to a max of 10s, if not 5s: How am I supposed to even handle the error?
D
Dylan Hunt
said
over 3 years ago
Example in Current State:
I call my optional API with a ping/pong to check isOnline - if offline, I'd just skip it.
http gets stuck on GET until the script (not http call), itself, times out!
Not only does the script timeout for this optional check, the error is simply { "error" : "timed out" }, not even allowing you to leave further diagnostic info.
If I were able to leave a timeout, I could skip it if no response instead of timing out the entire script (which is gamebreaking).
If I were able to leave a timeout, I could add additional error information to properly debug.
If I were able to leave a timeout, I could send a webhook to myself to let me know that x service is out instead of trying to debug a vague timeout error.
If I were able to leave a timeout, 3rd-party API calls that have maintenance or outages won't 100% block your GS scripts.This would further lead to less CPU time locked, leading to more $$ GS would save.
It's very standard to set a low timeout for HTTP calls: That said, this is not a feature request, but a question for either a fix or workaround:
A) @ GS: My friends, can you please, please fix the timeout timer (and preferably set the default to ~3 to 5s like most other folks do)? There's no reason why a no-response API call should block an entire script without any way to handle it.
B) Meanwhile, how to workaround HTTP call timeouts? I tried testing a few creative ways, but alas, no dice.
C
Charles Russell
said
over 3 years ago
Script timeouts are 10 seconds now. I would just limit that API call to only handle the SparkHttp. If you get a timeout, the HTTP Post failed. If you dont, handle the rest of the logic from that response point. However, why cant the client handle the HTTP Post separate from GameSparks?
J
Jeff Amiel
said
over 3 years ago
A custom timeout (in milliseconds) can be passed as an additional argument, like:
Marcin Olszewski
Hi Marcin,
The SparkHTTP timeout isn't strictly defined but does adhere to the timeout of script executions on the platform, which is approx 30 seconds.
-Pádraig
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Marcin,
The SparkHTTP timeout isn't strictly defined but does adhere to the timeout of script executions on the platform, which is approx 30 seconds.
-Pádraig
Dylan Hunt
How to explicitly define it? 30s for an HTTP timeout means your entire call will timeout with 0 error info even for a simple ping/pong request, if the other side times out.
Surely there must be a way? For example, right now, our entire game is offline while I skip a simple ping/pong request while our server is down.
Even then, the default *should* be explicitly defined to a max of 10s, if not 5s: How am I supposed to even handle the error?
Dylan Hunt
Example in Current State:
A) @ GS: My friends, can you please, please fix the timeout timer (and preferably set the default to ~3 to 5s like most other folks do)? There's no reason why a no-response API call should block an entire script without any way to handle it.
Charles Russell
Script timeouts are 10 seconds now. I would just limit that API call to only handle the SparkHttp. If you get a timeout, the HTTP Post failed. If you dont, handle the rest of the logic from that response point. However, why cant the client handle the HTTP Post separate from GameSparks?
Jeff Amiel
A custom timeout (in milliseconds) can be passed as an additional argument, like:
var httpSender = Spark.getHttp("http://somehost”, 10000);
Note that he actual response from a 'Spark.getHttp("http://somehost”, 1000).get()' is null (if timeout is triggered)
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics