File tree Expand file tree Collapse file tree 1 file changed +14
-18
lines changed
turbopack/crates/turbo-tasks-fs/src Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Original file line number Diff line number Diff line change 11use std:: {
22 io:: { self , ErrorKind } ,
33 path:: { Path , PathBuf } ,
4- thread:: sleep,
54 time:: Duration ,
65} ;
76
@@ -12,25 +11,22 @@ where
1211 F : Fn ( & Path ) -> io:: Result < R > + Send + ' static ,
1312 R : Send + ' static ,
1413{
15- turbo_tasks:: spawn_blocking ( move || {
16- let mut attempt = 1 ;
14+ let mut attempt = 1 ;
1715
18- loop {
19- return match func ( & path) {
20- Ok ( r) => Ok ( r) ,
21- Err ( err) => {
22- if attempt < MAX_RETRY_ATTEMPTS && can_retry ( & err) {
23- sleep ( get_retry_wait_time ( attempt) ) ;
24- attempt += 1 ;
25- continue ;
26- }
27-
28- Err ( err)
16+ loop {
17+ return match func ( & path) {
18+ Ok ( r) => Ok ( r) ,
19+ Err ( err) => {
20+ if attempt < MAX_RETRY_ATTEMPTS && can_retry ( & err) {
21+ tokio:: time:: sleep ( get_retry_wait_time ( attempt) ) . await ;
22+ attempt += 1 ;
23+ continue ;
2924 }
30- } ;
31- }
32- } )
33- . await
25+
26+ Err ( err)
27+ }
28+ } ;
29+ }
3430}
3531
3632fn can_retry ( err : & io:: Error ) -> bool {
You can’t perform that action at this time.
0 commit comments