File tree Expand file tree Collapse file tree 1 file changed +24
-9
lines changed Expand file tree Collapse file tree 1 file changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -59,16 +59,31 @@ pub static VYPER: LazyLock<Vyper> = LazyLock::new(|| {
5959 }
6060
6161 let base = "https://github.com/vyperlang/vyper/releases/download/v0.4.0/vyper.0.4.0+commit.e9db8d9f" ;
62- let url = format ! ( "{base}{}" , match platform( ) {
63- Platform :: MacOsAarch64 => "darwin" ,
64- Platform :: LinuxAmd64 => "linux" ,
65- Platform :: WindowsAmd64 => "windows.exe" ,
66- platform => panic!( "unsupported platform: {platform:?}" )
67- } ) ;
68-
69- let res = reqwest:: get ( url) . await . unwrap ( ) ;
62+ let url = format ! (
63+ "{base}{}" ,
64+ match platform( ) {
65+ Platform :: MacOsAarch64 => "darwin" ,
66+ Platform :: LinuxAmd64 => "linux" ,
67+ Platform :: WindowsAmd64 => "windows.exe" ,
68+ platform => panic!( "unsupported platform: {platform:?}" ) ,
69+ }
70+ ) ;
7071
71- assert ! ( res. status( ) . is_success( ) ) ;
72+ let mut retry = 3 ;
73+ let mut res = None ;
74+ while retry > 0 {
75+ match reqwest:: get ( & url) . await . unwrap ( ) . error_for_status ( ) {
76+ Ok ( res2) => {
77+ res = Some ( res2) ;
78+ break ;
79+ }
80+ Err ( e) => {
81+ eprintln ! ( "{e}" ) ;
82+ retry -= 1 ;
83+ }
84+ }
85+ }
86+ let res = res. expect ( "failed to get vyper binary" ) ;
7287
7388 let bytes = res. bytes ( ) . await . unwrap ( ) ;
7489
You can’t perform that action at this time.
0 commit comments