🌳
pt0/serverF/libFs/livePtySpawnF.mts
1import * as _ from 'lodash-es'
4import { liveSpawn } from './live1SpawnF.mts'
6type LiveSpawnProps = Parameters<typeof liveSpawn>[0]
8export const livePtySpawn = async (props: LiveSpawnProps): Promise<any> => {
9 try {
10 return await liveSpawn({...props, noOutCmd: true})
11 } catch (err: any) {
12 console.log({err})
13 await debug1Sleep(10 * 1000)
14 if (_.includes(err.message, 'posix_spawnp failed')) {
15 return await livePtySpawn(props)
16 }
17 throPtErr('!livePtySpawn', {err})
18 }