File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,11 @@ async fn main() {
12
12
13
13
let remote_url = "http://localhost:4007" ;
14
14
let server_sdk_key = "server-8ed48815ef044428826787e9a238b9c6a479f98c" ;
15
+ let interval = Duration :: from_millis ( 100 ) ;
15
16
let config = FPConfig {
16
17
remote_url : remote_url. to_owned ( ) ,
17
18
server_sdk_key : server_sdk_key. to_owned ( ) ,
18
- refresh_interval : Duration :: from_secs ( 5 ) ,
19
+ refresh_interval : interval ,
19
20
#[ cfg( feature = "use_tokio" ) ]
20
21
http_client : None ,
21
22
wait_first_resp : true ,
@@ -36,12 +37,14 @@ async fn main() {
36
37
37
38
let detail = fp. number_detail ( "promotion_activity" , & user, 9.0 ) ;
38
39
println ! ( " => reason : {:?}" , detail. reason) ;
39
- println ! ( " => index : {:?}" , detail. rule_index) ;
40
+ println ! ( " => rule index : {:?}" , detail. rule_index) ;
40
41
41
42
let user2 = FPUser :: new ( "user_id" ) . with ( "city" , "New York" ) ;
42
43
let discount2 = fp. number_value ( "promotion_activity" , & user2, 9.0 ) ;
43
44
println ! (
44
45
"Result => discount for user in New York is : {:?}" ,
45
46
discount2
46
47
) ;
48
+
49
+ tokio:: time:: sleep ( interval) . await ;
47
50
}
You can’t perform that action at this time.
0 commit comments