From 6ceeb01b5bffe784d101b11891b8fa549559bb13 Mon Sep 17 00:00:00 2001 From: Mike Clark Date: Tue, 4 Mar 2025 20:36:52 +0000 Subject: [PATCH] release notes --- packages/desktop-electron/index.ts | 21 ++++++++++----------- upcoming-release-notes/4526.md | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/desktop-electron/index.ts b/packages/desktop-electron/index.ts index 05076e4a945..49786d58f9a 100644 --- a/packages/desktop-electron/index.ts +++ b/packages/desktop-electron/index.ts @@ -223,23 +223,22 @@ async function startSyncServer() { 'app.js', ); + const webRoot = path.join( + // require.resolve will recursively search up the workspace for the module + path.dirname(require.resolve('@actual-app/web/package.json')), + 'build', + ); + // Use env variables to configure the server - let envVariables: Env = { + const envVariables: Env = { ...process.env, // required ACTUAL_PORT: `${syncServerConfig.port}`, ACTUAL_SERVER_FILES: `${syncServerConfig.ACTUAL_SERVER_FILES}`, ACTUAL_USER_FILES: `${syncServerConfig.ACTUAL_USER_FILES}`, ACTUAL_DATA_DIR: `${syncServerConfig.ACTUAL_SERVER_DATA_DIR}`, + ACTUAL_WEB_ROOT: webRoot, }; - const webRoot = path.join( - // require.resolve will recursively search up the workspace for the module - path.dirname(require.resolve('@actual-app/web/package.json')), - 'build', - ); - - envVariables = { ...envVariables, ACTUAL_WEB_ROOT: webRoot }; - // ACTUAL_SERVER_DATA_DIR is the root directory for the sync-server if (!fs.existsSync(syncServerConfig.ACTUAL_SERVER_DATA_DIR)) { mkdir(syncServerConfig.ACTUAL_SERVER_DATA_DIR, { recursive: true }); @@ -254,8 +253,6 @@ async function startSyncServer() { forkOptions = { ...forkOptions, execArgv: ['--inspect'] }; } - const SYNC_SERVER_WAIT_TIMEOUT = 15000; // wait 15 seconds for the server to start - if it doesn't, throw an error - let syncServerStarted = false; const syncServerPromise = new Promise(async resolve => { @@ -287,6 +284,8 @@ async function startSyncServer() { }); }); + const SYNC_SERVER_WAIT_TIMEOUT = 20000; // wait 20 seconds for the server to start - if it doesn't, throw an error + const syncServerTimeout = new Promise((_, reject) => { setTimeout(() => { if (!syncServerStarted) { diff --git a/upcoming-release-notes/4526.md b/upcoming-release-notes/4526.md index e6e3eba9e77..32e06cf0bcd 100644 --- a/upcoming-release-notes/4526.md +++ b/upcoming-release-notes/4526.md @@ -1,5 +1,5 @@ --- -category: Feature +category: Features authors: [MikesGlitch] ---