Skip to content

Commit

Permalink
release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
MikesGlitch committed Mar 4, 2025
1 parent 68a61dd commit 6ceeb01
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
21 changes: 10 additions & 11 deletions packages/desktop-electron/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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<void>(async resolve => {
Expand Down Expand Up @@ -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<void>((_, reject) => {
setTimeout(() => {
if (!syncServerStarted) {
Expand Down
2 changes: 1 addition & 1 deletion upcoming-release-notes/4526.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
category: Feature
category: Features
authors: [MikesGlitch]
---

Expand Down

0 comments on commit 6ceeb01

Please sign in to comment.