File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ architectures/armeabi-v7a=false
394
394
architectures/arm64-v8a =true
395
395
architectures/x86 =false
396
396
architectures/x86_64 =true
397
- version/code =16
397
+ version/code =17
398
398
version/name =" 1.0"
399
399
package/unique_name =" org.decentraland.godotexplorer"
400
400
package/name =" Decentraland"
Original file line number Diff line number Diff line change @@ -56,13 +56,22 @@ async fn fetch_polling_server(
56
56
) -> Result < ( String , serde_json:: Value ) , anyhow:: Error > {
57
57
let url = format ! ( "{AUTH_SERVER_ENDPOINT_URL}/{req_id}" ) ;
58
58
let mut attempt = 0 ;
59
+ let mut requested_time = std:: time:: Instant :: now ( ) ;
60
+
59
61
loop {
60
62
tracing:: debug!( "trying req_id {:?} attempt ${attempt}" , req_id) ;
61
63
if attempt >= AUTH_SERVER_RETRIES {
62
64
return Err ( anyhow:: Error :: msg ( "too many atempts" ) ) ;
63
65
}
64
66
attempt += 1 ;
65
67
68
+ let diff = ( std:: time:: Instant :: now ( ) - requested_time) . as_millis ( ) as i64 ;
69
+ let remaining_delay = ( AUTH_SERVER_RETRY_INTERVAL . as_millis ( ) as i64 ) - diff;
70
+ if remaining_delay > 0 {
71
+ tokio:: time:: sleep ( Duration :: from_millis ( remaining_delay as u64 ) ) . await ;
72
+ }
73
+
74
+ requested_time = std:: time:: Instant :: now ( ) ;
66
75
let response = reqwest:: Client :: builder ( )
67
76
. timeout ( AUTH_SERVER_REQUEST_TIMEOUT )
68
77
. build ( )
@@ -74,7 +83,6 @@ async fn fetch_polling_server(
74
83
let response = match response {
75
84
Ok ( response) => {
76
85
if response. status ( ) . as_u16 ( ) == 204 {
77
- tokio:: time:: sleep ( AUTH_SERVER_RETRY_INTERVAL ) . await ;
78
86
continue ;
79
87
} else if response. status ( ) . is_success ( ) {
80
88
match response. json :: < RequestResult > ( ) . await {
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ fn op_get_file_url(
46
46
} ) ;
47
47
}
48
48
49
- Err ( anyhow ! ( "not found" ) )
49
+ Err ( anyhow ! ( "not found {filename} " ) )
50
50
}
51
51
52
52
#[ op]
You can’t perform that action at this time.
0 commit comments