@@ -7,9 +7,24 @@ import {Emitter, Disposable, CompositeDisposable} from 'event-kit';
77
88import { getPackageRoot , autobind } from './helpers' ;
99
10+ // Whether `WorkerManager` is enabled. If not, it will never mark itself as
11+ // ready, and `GitShellOutStrategy` will use its fallback approach of spawning
12+ // `git` processes more directly via `dugite` (which works fine). This allows
13+ // us to bail without even trying to start another renderer process.
14+ //
15+ // NOTE: For the reasons explained in
16+ // https://github.com/pulsar-edit/github/pull/45, `WorkerManager` is now
17+ // permanently disabled. This automatically triggers the fallback strategy
18+ // described above and is a prelude to the removal of `WorkerManager` entirely.
19+ const ENABLED = false ;
20+
1021export default class WorkerManager {
1122 static instance = null ;
1223
24+ static isEnabled ( ) {
25+ return ENABLED ;
26+ }
27+
1328 static getInstance ( ) {
1429 if ( ! this . instance ) {
1530 this . instance = new WorkerManager ( ) ;
@@ -123,6 +138,7 @@ export class Worker {
123138 this . completedOperationCount = 0 ;
124139 this . sick = false ;
125140
141+ if ( ! ENABLED ) return ;
126142 this . rendererProcess = new RendererProcess ( {
127143 loadUrl : this . getLoadUrl ( operationCountLimit ) ,
128144 onData : this . handleDataReceived ,
@@ -137,6 +153,7 @@ export class Worker {
137153 }
138154
139155 isReady ( ) {
156+ if ( ! ENABLED ) return false ;
140157 return this . rendererProcess . isReady ( ) ;
141158 }
142159
0 commit comments