File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ function createServer (storage, opts) {
150
150
async function simulator ( ) {
151
151
if ( argv . _ . length === 1 ) throw new Error ( 'Must provide a script for the simulator to run.' )
152
152
const scriptPath = p . resolve ( argv . _ [ 1 ] )
153
- const simulatorId = await getUnusedSocket ( )
153
+ const simulatorId = `hyperspace-simulator- ${ process . pid } `
154
154
process . env . HYPERSPACE_SOCKET = simulatorId
155
155
156
156
const server = createServer ( ram , {
@@ -174,18 +174,6 @@ async function simulator () {
174
174
console . log ( 'Shutting down simulator...' )
175
175
server . close ( ) . catch ( onerror )
176
176
}
177
-
178
- async function getUnusedSocket ( ) {
179
- const host = `hyperspace-simulator-${ ( Math . floor ( Math . random ( ) * 1e9 ) ) . toString ( 16 ) } `
180
- const socketPath = getNetworkOptions ( { host } )
181
- try {
182
- await fs . stat ( socketPath )
183
- return getUnusedSocket ( )
184
- } catch ( err ) {
185
- if ( err . code !== 'ENOENT' ) throw err
186
- return host
187
- }
188
- }
189
177
}
190
178
191
179
async function getStoragePath ( ) {
You can’t perform that action at this time.
0 commit comments