Skip to content

Commit 838d81e

Browse files
author
“chae-dahee”
committed
fix: parallel 함수 경로 수정
1 parent 5dae061 commit 838d81e

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

packages/vscode/src/test/utils/gitParallel.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe("GitParallelWorkerManager", () => {
4343

4444
beforeEach(() => {
4545
jest.clearAllMocks();
46-
workerManager = new GitParallelWorkerManager();
46+
workerManager = new GitParallelWorkerManager("dummy/path/to/worker.js");
4747
});
4848

4949
describe("Worker count calculation", () => {
@@ -109,7 +109,7 @@ describe("GitParallelWorkerManager", () => {
109109

110110
beforeEach(async () => {
111111
const { GitParallelWorkerManager } = await import("../../utils/gitParallel");
112-
errorWorkerManager = new GitParallelWorkerManager();
112+
errorWorkerManager = new GitParallelWorkerManager("dummy/path/to/worker.js");
113113
});
114114

115115
it("should throw an exception if the worker fails", async () => {

packages/vscode/src/utils/gitParallel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ export class GitParallelWorkerManager {
3434
private readonly config: WorkerConfig;
3535
private workers: Worker[] = [];
3636

37-
constructor(config: Partial<WorkerConfig> = {}) {
37+
constructor(workerScriptPath: string, config: Partial<WorkerConfig> = {}) {
3838
this.config = {
3939
taskThreshold: TASK_THRESHOLD,
4040
coreCountThreshold: CORE_COUNT_THRESHOLD,
41-
workerScriptPath: path.resolve(__dirname, "./gitWorker.js"),
41+
workerScriptPath,
4242
...config,
4343
};
4444
}

packages/vscode/src/utils/gitUtil.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,13 @@ export async function getLogCount(gitPath: string, currentWorkspacePath: string)
204204
return parseInt(stdout.toString().trim(), BASE_10);
205205
}
206206

207-
export async function fetchGitLogInParallel(gitPath: string, currentWorkspacePath: string): Promise<string> {
207+
export async function fetchGitLogInParallel(
208+
gitPath: string,
209+
currentWorkspacePath: string,
210+
workerPath: string
211+
): Promise<string> {
208212
const totalCnt = await getLogCount(gitPath, currentWorkspacePath);
209-
const workerManager = new GitParallelWorkerManager();
213+
const workerManager = new GitParallelWorkerManager(workerPath);
210214
return workerManager.executeParallelGitLog(gitPath, currentWorkspacePath, totalCnt);
211215
}
212216

0 commit comments

Comments
 (0)