File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ class ProxyServerSystem extends EventEmitter {
5656
5757 async start ( initialAuthIndex = null ) {
5858 this . logger . info ( "[System] Starting flexible startup process..." ) ;
59+ await this . _startHttpServer ( ) ;
60+ await this . _startWebSocketServer ( ) ;
61+ this . logger . info ( `[System] Proxy server system startup complete.` ) ;
62+
5963 const allAvailableIndices = this . authSource . availableIndices ;
6064
6165 if ( allAvailableIndices . length === 0 ) {
@@ -86,13 +90,16 @@ class ProxyServerSystem extends EventEmitter {
8690 for ( const index of startupOrder ) {
8791 try {
8892 this . logger . info ( `[System] Attempting to start service with account #${ index } ...` ) ;
93+ this . requestHandler . authSwitcher . isSystemBusy = true ;
8994 await this . browserManager . launchOrSwitchContext ( index ) ;
9095
9196 isStarted = true ;
9297 this . logger . info ( `[System] ✅ Successfully started with account #${ index } !` ) ;
9398 break ;
9499 } catch ( error ) {
95100 this . logger . error ( `[System] ❌ Failed to start with account #${ index } . Reason: ${ error . message } ` ) ;
101+ } finally {
102+ this . requestHandler . authSwitcher . isSystemBusy = false ;
96103 }
97104 }
98105
@@ -103,9 +110,6 @@ class ProxyServerSystem extends EventEmitter {
103110 // Don't throw an error, just proceed to start servers
104111 }
105112
106- await this . _startHttpServer ( ) ;
107- await this . _startWebSocketServer ( ) ;
108- this . logger . info ( `[System] Proxy server system startup complete.` ) ;
109113 this . emit ( "started" ) ;
110114 }
111115
You can’t perform that action at this time.
0 commit comments