@@ -21,7 +21,6 @@ pub async fn search(query: String, page: u32) -> Result<SearchResultsPage, Serve
2121 TextSearchRequest :: from_query_str_with_page ( & query, normalized_page, DEFAULT_PAGE_SIZE )
2222 . map_err ( |e| ServerFnError :: new ( e. to_string ( ) ) ) ?;
2323 let state = expect_context :: < crate :: server:: GlobalAppState > ( ) ;
24- let state = state. lock ( ) . await ;
2524 let db = PostgresDb :: new ( state. pool . clone ( ) ) ;
2625 db. text_search ( & request)
2726 . await
@@ -34,7 +33,6 @@ pub async fn autocomplete_repositories(
3433 limit : i64 ,
3534) -> Result < Vec < String > , ServerFnError > {
3635 let state = expect_context :: < crate :: server:: GlobalAppState > ( ) ;
37- let state = state. lock ( ) . await ;
3836 let db = PostgresDb :: new ( state. pool . clone ( ) ) ;
3937 let normalized_limit = limit. max ( 1 ) . min ( 20 ) ;
4038 db. autocomplete_repositories ( term. trim ( ) , normalized_limit)
@@ -49,7 +47,6 @@ pub async fn autocomplete_paths(
4947 limit : i64 ,
5048) -> Result < Vec < String > , ServerFnError > {
5149 let state = expect_context :: < crate :: server:: GlobalAppState > ( ) ;
52- let state = state. lock ( ) . await ;
5350 let db = PostgresDb :: new ( state. pool . clone ( ) ) ;
5451 let normalized_limit = limit. max ( 1 ) . min ( 20 ) ;
5552 let repos: Vec < String > = repositories
@@ -72,7 +69,6 @@ pub async fn autocomplete_symbols(
7269 return Ok ( Vec :: new ( ) ) ;
7370 }
7471 let state = expect_context :: < crate :: server:: GlobalAppState > ( ) ;
75- let state = state. lock ( ) . await ;
7672 let db = PostgresDb :: new ( state. pool . clone ( ) ) ;
7773 let normalized_limit = limit. max ( 1 ) . min ( 20 ) ;
7874 db. autocomplete_symbols ( trimmed, normalized_limit)
@@ -87,7 +83,6 @@ pub async fn autocomplete_languages(
8783 limit : i64 ,
8884) -> Result < Vec < String > , ServerFnError > {
8985 let state = expect_context :: < crate :: server:: GlobalAppState > ( ) ;
90- let state = state. lock ( ) . await ;
9186 let db = PostgresDb :: new ( state. pool . clone ( ) ) ;
9287 let normalized_limit = limit. max ( 1 ) . min ( 20 ) ;
9388 let repos: Vec < String > = repositories
@@ -107,7 +102,6 @@ pub async fn autocomplete_branches(
107102 limit : i64 ,
108103) -> Result < Vec < String > , ServerFnError > {
109104 let state = expect_context :: < crate :: server:: GlobalAppState > ( ) ;
110- let state = state. lock ( ) . await ;
111105 let db = PostgresDb :: new ( state. pool . clone ( ) ) ;
112106 let normalized_limit = limit. max ( 1 ) . min ( 20 ) ;
113107 let repos: Vec < String > = repositories
@@ -127,7 +121,6 @@ pub async fn autocomplete_files(
127121 limit : i64 ,
128122) -> Result < Vec < String > , ServerFnError > {
129123 let state = expect_context :: < crate :: server:: GlobalAppState > ( ) ;
130- let state = state. lock ( ) . await ;
131124 let db = PostgresDb :: new ( state. pool . clone ( ) ) ;
132125 let normalized_limit = limit. max ( 1 ) . min ( 20 ) ;
133126 let repos: Vec < String > = repositories
0 commit comments