@@ -112,16 +112,12 @@ internal async Task<string> ReadApplicationLogAsync(string functionName, int log
112112 using var client = new HttpClient ( ) ;
113113 ListingEntry [ ] listingResult = null ;
114114
115- TimeSpan [ ] delay = {
116- new TimeSpan ( 0 , 0 , 5 ) ,
117- new TimeSpan ( 0 , 0 , 12 ) ,
118- new TimeSpan ( 0 , 0 , 25 ) ,
119- new TimeSpan ( 0 , 0 , 55 ) ,
120- new TimeSpan ( 0 , 1 , 30 ) ,
121- } ;
122- for ( int attempt = 0 ; attempt < delay . Length ; attempt ++ )
115+ string delayList = Environment . GetEnvironmentVariable ( "AGGREGATOR_KUDU_LOGRETRIEVE_ATTEMPTS" )
116+ ?? "0:0:5 0:0:12 0:0:25 0:0:55 0:1:30" ;
117+ var delay = delayList . Split ( ' ' ) . Select ( s => TimeSpan . Parse ( s ) ) . ToList ( ) ;
118+ for ( int attempt = 0 ; attempt < delay . Count ; attempt ++ )
123119 {
124- logger . WriteVerbose ( $ "Listing attempt #{ attempt + 1 } ) ") ;
120+ logger . WriteVerbose ( $ "Attempt #{ attempt + 1 } to retrieve listing ") ;
125121 using var listingRequest = await GetRequestAsync ( HttpMethod . Get , $ "{ FunctionLogPath } /{ functionName } /", cancellationToken ) ;
126122 var listingResponse = await client . SendAsync ( listingRequest , cancellationToken ) ;
127123 var listingStream = await listingResponse . Content . ReadAsStreamAsync ( cancellationToken ) ;
0 commit comments