File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,17 @@ use graph_node::{launcher, opt};
99
1010git_testament ! ( TESTAMENT ) ;
1111
12- fn main ( ) {
13- let max_blocking : usize = std:: env:: var ( "GRAPH_MAX_BLOCKING_THREADS" )
12+ lazy_static ! {
13+ pub static ref MAX_BLOCKING_THREADS : usize = std:: env:: var( "GRAPH_MAX_BLOCKING_THREADS" )
1414 . ok( )
1515 . and_then( |v| v. parse( ) . ok( ) )
1616 . unwrap_or( 512 ) ;
17+ }
1718
19+ fn main ( ) {
1820 tokio:: runtime:: Builder :: new_multi_thread ( )
1921 . enable_all ( )
20- . max_blocking_threads ( max_blocking )
22+ . max_blocking_threads ( * MAX_BLOCKING_THREADS )
2123 . build ( )
2224 . unwrap ( )
2325 . block_on ( async { main_inner ( ) . await } )
@@ -30,7 +32,10 @@ async fn main_inner() {
3032
3133 // Set up logger
3234 let logger = logger ( opt. debug ) ;
33-
35+ debug ! (
36+ logger,
37+ "Runtime configured with {} max blocking threads" , * MAX_BLOCKING_THREADS
38+ ) ;
3439 let ipfs_client = graph:: ipfs:: new_ipfs_client ( & opt. ipfs , & logger)
3540 . await
3641 . unwrap_or_else ( |err| panic ! ( "Failed to create IPFS client: {err:#}" ) ) ;
You can’t perform that action at this time.
0 commit comments