Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/git-shell-out-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export default class GitShellOutStrategy {
}

executeGitCommand(args, options, marker = null) {
if (process.env.ATOM_GITHUB_INLINE_GIT_EXEC || !WorkerManager.getInstance().isReady()) {
if (process.env.ATOM_GITHUB_INLINE_GIT_EXEC || !WorkerManager.isEnabled() || !WorkerManager.getInstance().isReady()) {
marker && marker.mark('nexttick');

let childPid;
Expand Down
12 changes: 12 additions & 0 deletions lib/worker-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ import {Emitter, Disposable, CompositeDisposable} from 'event-kit';

import {getPackageRoot, autobind} from './helpers';

// Whether `WorkerManager` is enabled. If not, it will never mark itself as
// ready, and `GitShellOutStrategy` will use its fallback approach of spawning
// `git` processes more directly via `dugite` (which works fine). This allows
// us to bail without even trying to start another renderer process.
const ENABLED = false;

export default class WorkerManager {
static instance = null;

static isEnabled () {
return ENABLED;
}

static getInstance() {
if (!this.instance) {
this.instance = new WorkerManager();
Expand Down Expand Up @@ -123,6 +133,7 @@ export class Worker {
this.completedOperationCount = 0;
this.sick = false;

if (!ENABLED) return;
this.rendererProcess = new RendererProcess({
loadUrl: this.getLoadUrl(operationCountLimit),
onData: this.handleDataReceived,
Expand All @@ -137,6 +148,7 @@ export class Worker {
}

isReady() {
if (!ENABLED) return false;
return this.rendererProcess.isReady();
}

Expand Down
Loading