@@ -284,34 +284,36 @@ export const cleanupAll = async (serverId?: string) => {
284284} ;
285285
286286export const cleanupAllBackground = async ( serverId ?: string ) => {
287- Promise . allSettled (
288- ( Object . entries ( cleanupCommands ) as [
289- keyof typeof cleanupCommands ,
290- string
291- ] [ ] )
292- . filter ( ( [ key ] ) => ! excludedCleanupAllCommands . includes ( key ) )
293- . map ( async ( [ , command ] ) => {
294- if ( serverId ) {
295- await execAsyncRemote ( serverId , dockerSafeExec ( command ) ) ;
296- } else {
297- await execAsync ( dockerSafeExec ( command ) ) ;
298- }
299- } )
300- )
301- . then ( ( results ) => {
302- const failed = results . filter ( ( r ) => r . status === "rejected" ) ;
303- if ( failed . length > 0 ) {
304- console . error ( `Docker cleanup: ${ failed . length } operations failed` ) ;
305- } else {
306- console . log ( "Docker cleanup completed successfully" ) ;
307- }
308- } )
309- . catch ( ( error ) => console . error ( "Error in cleanup:" , error ) ) ;
310-
311- return {
312- status : "scheduled" ,
313- message : "Docker cleanup has been initiated in the background" ,
314- } ;
287+ Promise . allSettled (
288+ (
289+ Object . entries ( cleanupCommands ) as [
290+ keyof typeof cleanupCommands ,
291+ string ,
292+ ] [ ]
293+ )
294+ . filter ( ( [ key ] ) => ! excludedCleanupAllCommands . includes ( key ) )
295+ . map ( async ( [ , command ] ) => {
296+ if ( serverId ) {
297+ await execAsyncRemote ( serverId , dockerSafeExec ( command ) ) ;
298+ } else {
299+ await execAsync ( dockerSafeExec ( command ) ) ;
300+ }
301+ } ) ,
302+ )
303+ . then ( ( results ) => {
304+ const failed = results . filter ( ( r ) => r . status === "rejected" ) ;
305+ if ( failed . length > 0 ) {
306+ console . error ( `Docker cleanup: ${ failed . length } operations failed` ) ;
307+ } else {
308+ console . log ( "Docker cleanup completed successfully" ) ;
309+ }
310+ } )
311+ . catch ( ( error ) => console . error ( "Error in cleanup:" , error ) ) ;
312+
313+ return {
314+ status : "scheduled" ,
315+ message : "Docker cleanup has been initiated in the background" ,
316+ } ;
315317} ;
316318
317319export const startService = async ( appName : string ) => {
0 commit comments