File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed
packages/server/src/setup Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,16 @@ export const initializePostgres = async () => {
5454 version : Number . parseInt ( inspect . Version . Index ) ,
5555 ...settings ,
5656 } ) ;
57-
5857 console . log ( "Postgres Started ✅" ) ;
5958 } catch ( error ) {
60- await docker . createService ( settings ) ;
59+ try {
60+ await docker . createService ( settings ) ;
61+ } catch ( error : any ) {
62+ if ( error ?. statusCode !== 409 ) {
63+ throw error ;
64+ }
65+ console . log ( "Postgres service already exists, continuing..." ) ;
66+ }
6167 console . log ( "Postgres Not Found: Starting ✅" ) ;
6268 }
6369} ;
Original file line number Diff line number Diff line change @@ -53,7 +53,14 @@ export const initializeRedis = async () => {
5353 } ) ;
5454 console . log ( "Redis Started ✅" ) ;
5555 } catch ( error ) {
56- await docker . createService ( settings ) ;
56+ try {
57+ await docker . createService ( settings ) ;
58+ } catch ( error : any ) {
59+ if ( error ?. statusCode !== 409 ) {
60+ throw error ;
61+ }
62+ console . log ( "Redis service already exists, continuing..." ) ;
63+ }
5764 console . log ( "Redis Not Found: Starting ✅" ) ;
5865 }
5966} ;
Original file line number Diff line number Diff line change @@ -128,7 +128,14 @@ export const initializeTraefik = async ({
128128
129129 console . log ( "Traefik Started ✅" ) ;
130130 } catch ( error ) {
131- await docker . createService ( settings ) ;
131+ try {
132+ await docker . createService ( settings ) ;
133+ } catch ( error : any ) {
134+ if ( error ?. statusCode !== 409 ) {
135+ throw error ;
136+ }
137+ console . log ( "Traefik service already exists, continuing..." ) ;
138+ }
132139 console . log ( "Traefik Not Found: Starting ✅" ) ;
133140 }
134141} ;
You can’t perform that action at this time.
0 commit comments