Skip to content

Commit 759f6ef

Browse files
change to importing randomUUID instead of whole crypto module
1 parent 8df5c42 commit 759f6ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libraries/Executor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ExecuteFileReturn, InstalledMySQLVersion, InternalServerOptions, MySQLD
99
import {normalize as normalizePath, resolve as resolvePath} from 'path'
1010
import { lockFile, waitForLock } from "./FileLock";
1111
import { onExit } from "signal-exit";
12-
import * as crypto from 'crypto'
12+
import { randomUUID } from "crypto";
1313

1414
class Executor {
1515
logger: Logger;
@@ -89,8 +89,8 @@ class Executor {
8989
return new Promise(async (resolve, reject) => {
9090
await fsPromises.rm(logFile, {force: true})
9191

92-
const socket = os.platform() === 'win32' ? `MySQL-${crypto.randomUUID()}` : `${dbPath}/m.sock`
93-
const xSocket = os.platform() === 'win32' ? `MySQLX-${crypto.randomUUID()}` : `${dbPath}/x.sock`
92+
const socket = os.platform() === 'win32' ? `MySQL-${randomUUID()}` : `${dbPath}/m.sock`
93+
const xSocket = os.platform() === 'win32' ? `MySQLX-${randomUUID()}` : `${dbPath}/x.sock`
9494

9595
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: this.DBDestroySignal.signal, killSignal: 'SIGKILL'})
9696

0 commit comments

Comments
 (0)