File tree Expand file tree Collapse file tree
benchmesh-serial-service/src/benchmesh_service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,6 +83,11 @@ def _mount_static_ui_if_built(app: FastAPI):
8383 if os .path .isdir (dist_dir ):
8484 app .mount ("/ui" , StaticFiles (directory = dist_dir , html = True ), name = "ui" )
8585
86+ # Add root redirect to UI
87+ @app .get ("/" )
88+ async def root_redirect ():
89+ return RedirectResponse (url = "/ui/" )
90+
8691
8792def _coerce_arg (v : str ) -> Any :
8893 s = v .strip ()
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ function stopProcesses() {
155155 } )
156156}
157157
158- async function waitForBackend ( retries = 20 , delay = 500 ) {
158+ async function waitForBackend ( retries = 30 , delay = 1000 ) {
159159 for ( let i = 0 ; i < retries ; i ++ ) {
160160 try {
161161 const http = require ( 'http' )
@@ -164,14 +164,16 @@ async function waitForBackend(retries = 20, delay = 500) {
164164 resolve ( res . statusCode === 200 )
165165 } )
166166 req . on ( 'error' , ( ) => resolve ( false ) )
167- req . setTimeout ( 1000 , ( ) => {
167+ req . setTimeout ( 2000 , ( ) => {
168168 req . destroy ( )
169169 resolve ( false )
170170 } )
171171 } )
172172
173173 if ( response ) {
174174 console . log ( 'Backend is ready!' )
175+ // Give it a bit more time to fully initialize
176+ await new Promise ( resolve => setTimeout ( resolve , 1000 ) )
175177 return true
176178 }
177179 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments