Skip to content

Commit c0f5bf2

Browse files
authored
Remove queue worker initialization (#149)
1 parent ecbf1b8 commit c0f5bf2

File tree

6 files changed

+4
-56
lines changed

6 files changed

+4
-56
lines changed

resources/js/electron-plugin/dist/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { app } from "electron";
1111
import { autoUpdater } from "electron-updater";
1212
import state from "./server/state";
1313
import { electronApp, optimizer } from "@electron-toolkit/utils";
14-
import { retrieveNativePHPConfig, retrievePhpIniSettings, runScheduler, startAPI, startPhpApp, startQueue, } from "./server";
14+
import { retrieveNativePHPConfig, retrievePhpIniSettings, runScheduler, startAPI, startPhpApp, } from "./server";
1515
import { notifyLaravel } from "./server/utils";
1616
import { resolve } from "path";
1717
import { stopAllProcesses } from "./server/api/childProcess";
@@ -75,7 +75,6 @@ class NativePHP {
7575
yield this.startElectronApi();
7676
state.phpIni = yield this.loadPhpIni();
7777
yield this.startPhpApp();
78-
yield this.startQueueWorker();
7978
this.startScheduler();
8079
yield notifyLaravel("booted");
8180
});
@@ -148,11 +147,6 @@ class NativePHP {
148147
this.processes.push(yield startPhpApp());
149148
});
150149
}
151-
startQueueWorker() {
152-
return __awaiter(this, void 0, void 0, function* () {
153-
this.processes.push(yield startQueue());
154-
});
155-
}
156150
startScheduler() {
157151
const now = new Date();
158152
const delay = (60 - now.getSeconds()) * 1000 + (1000 - now.getMilliseconds());

resources/js/electron-plugin/dist/server/index.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
88
});
99
};
1010
import startAPIServer from "./api";
11-
import { retrieveNativePHPConfig, retrievePhpIniSettings, serveApp, startQueueWorker, startScheduler, } from "./php";
11+
import { retrieveNativePHPConfig, retrievePhpIniSettings, serveApp, startScheduler, } from "./php";
1212
import { appendCookie } from "./utils";
1313
import state from "./state";
1414
export function startPhpApp() {
@@ -19,14 +19,6 @@ export function startPhpApp() {
1919
return result.process;
2020
});
2121
}
22-
export function startQueue() {
23-
if (!process.env.NATIVE_PHP_SKIP_QUEUE) {
24-
return startQueueWorker(state.randomSecret, state.electronApiPort, state.phpIni);
25-
}
26-
else {
27-
return undefined;
28-
}
29-
}
3022
export function runScheduler() {
3123
startScheduler(state.randomSecret, state.electronApiPort, state.phpIni);
3224
}

resources/js/electron-plugin/dist/server/php.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,6 @@ function ensureAppFoldersAreAvailable() {
9595
writeFileSync(databaseFile, '');
9696
}
9797
}
98-
function startQueueWorker(secret, apiPort, phpIniSettings = {}) {
99-
const env = getDefaultEnvironmentVariables(secret, apiPort);
100-
const phpOptions = {
101-
cwd: appPath,
102-
env
103-
};
104-
return callPhp(['artisan', 'queue:work', '-q'], phpOptions, phpIniSettings);
105-
}
10698
function startScheduler(secret, apiPort, phpIniSettings = {}) {
10799
const env = getDefaultEnvironmentVariables(secret, apiPort);
108100
const phpOptions = {
@@ -214,4 +206,4 @@ function serveApp(secret, apiPort, phpIniSettings) {
214206
});
215207
}));
216208
}
217-
export { startQueueWorker, startScheduler, serveApp, getAppPath, retrieveNativePHPConfig, retrievePhpIniSettings, getDefaultEnvironmentVariables, getDefaultPhpIniSettings };
209+
export { startScheduler, serveApp, getAppPath, retrieveNativePHPConfig, retrievePhpIniSettings, getDefaultEnvironmentVariables, getDefaultPhpIniSettings };

resources/js/electron-plugin/src/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
runScheduler,
1010
startAPI,
1111
startPhpApp,
12-
startQueue,
1312
} from "./server";
1413
import { notifyLaravel } from "./server/utils";
1514
import { resolve } from "path";
@@ -101,7 +100,6 @@ class NativePHP {
101100
state.phpIni = await this.loadPhpIni();
102101

103102
await this.startPhpApp();
104-
await this.startQueueWorker();
105103
this.startScheduler();
106104

107105
await notifyLaravel("booted");
@@ -184,10 +182,6 @@ class NativePHP {
184182
this.processes.push(await startPhpApp());
185183
}
186184

187-
private async startQueueWorker() {
188-
this.processes.push(await startQueue());
189-
}
190-
191185
private startScheduler() {
192186
const now = new Date();
193187
const delay =

resources/js/electron-plugin/src/server/index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
retrieveNativePHPConfig,
44
retrievePhpIniSettings,
55
serveApp,
6-
startQueueWorker,
76
startScheduler,
87
} from "./php";
98
import { appendCookie } from "./utils";
@@ -23,18 +22,6 @@ export async function startPhpApp() {
2322
return result.process;
2423
}
2524

26-
export function startQueue() {
27-
if (!process.env.NATIVE_PHP_SKIP_QUEUE) {
28-
return startQueueWorker(
29-
state.randomSecret,
30-
state.electronApiPort,
31-
state.phpIni
32-
);
33-
} else {
34-
return undefined;
35-
}
36-
}
37-
3825
export function runScheduler() {
3926
startScheduler(state.randomSecret, state.electronApiPort, state.phpIni);
4027
}

resources/js/electron-plugin/src/server/php.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,6 @@ function ensureAppFoldersAreAvailable() {
114114
}
115115
}
116116

117-
function startQueueWorker(secret, apiPort, phpIniSettings = {}) {
118-
const env = getDefaultEnvironmentVariables(secret, apiPort);
119-
120-
const phpOptions = {
121-
cwd: appPath,
122-
env
123-
};
124-
125-
return callPhp(['artisan', 'queue:work', '-q'], phpOptions, phpIniSettings);
126-
}
127-
128117
function startScheduler(secret, apiPort, phpIniSettings = {}) {
129118
const env = getDefaultEnvironmentVariables(secret, apiPort);
130119

@@ -262,4 +251,4 @@ function serveApp(secret, apiPort, phpIniSettings): Promise<ProcessResult> {
262251
})
263252
}
264253

265-
export {startQueueWorker, startScheduler, serveApp, getAppPath, retrieveNativePHPConfig, retrievePhpIniSettings, getDefaultEnvironmentVariables, getDefaultPhpIniSettings}
254+
export {startScheduler, serveApp, getAppPath, retrieveNativePHPConfig, retrievePhpIniSettings, getDefaultEnvironmentVariables, getDefaultPhpIniSettings}

0 commit comments

Comments
 (0)