Skip to content

Commit

Permalink
socket parameter is now named pipe name if running on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian-Webster committed Nov 16, 2024
1 parent 5a2783c commit 20a09b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libraries/Executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ class Executor {
return new Promise(async (resolve, reject) => {
await fsPromises.rm(logFile, {force: true})

const process = spawn(binaryFilepath, ['--no-defaults', `--port=${port}`, `--datadir=${datadir}`, `--mysqlx-port=${mySQLXPort}`, `--mysqlx-socket=${dbPath}/x.sock`, `--socket=${dbPath}/m.sock`, `--general-log-file=${logFile}`, '--general-log=1', `--init-file=${dbPath}/init.sql`, '--bind-address=127.0.0.1', '--innodb-doublewrite=OFF', '--mysqlx=FORCE', `--log-error=${errorLogFile}`, `--user=${os.userInfo().username}`], {signal: DBDestroySignal.signal, killSignal: 'SIGKILL'})
const socket = os.platform() === 'win32' ? `MySQL-${crypto.randomUUID()}` : `${dbPath}/m.sock`
const xSocket = os.platform() === 'win32' ? `MySQLX-${crypto.randomUUID()}` : `${dbPath}/x.sock`

const process = spawn(binaryFilepath, ['--no-defaults', `--port=${port}`, `--datadir=${datadir}`, `--mysqlx-port=${mySQLXPort}`, `--mysqlx-socket=${xSocket}`, `--socket=${socket}`, `--general-log-file=${logFile}`, '--general-log=1', `--init-file=${dbPath}/init.sql`, '--bind-address=127.0.0.1', '--innodb-doublewrite=OFF', '--mysqlx=FORCE', `--log-error=${errorLogFile}`, `--user=${os.userInfo().username}`], {signal: DBDestroySignal.signal, killSignal: 'SIGKILL'})

//resolveFunction is the function that will be called to resolve the promise that stops the database.
//If resolveFunction is not undefined, the database has received a kill signal and data cleanup procedures should run.
Expand Down

0 comments on commit 20a09b0

Please sign in to comment.