Resolve possible update memory leak.,

This commit is contained in:
Patrick FIc
2025-10-21 10:03:40 -07:00
parent 6674f33be9
commit bf1e137c6c
5 changed files with 38 additions and 8 deletions

View File

@@ -10,6 +10,12 @@ export default defineConfig({
sentryVitePlugin({ sentryVitePlugin({
org: "imex", org: "imex",
project: "imex-partner", project: "imex-partner",
sourcemaps: {
filesToDeleteAfterUpload: ["**.js.map"],
},
release: {
name: `bodyshop-desktop@${process.env.npm_package_version}`,
},
}), }),
], ],
build: { build: {
@@ -32,6 +38,12 @@ export default defineConfig({
sentryVitePlugin({ sentryVitePlugin({
org: "imex", org: "imex",
project: "imex-partner", project: "imex-partner",
sourcemaps: {
filesToDeleteAfterUpload: ["**.js.map"],
},
release: {
name: `bodyshop-desktop@${process.env.npm_package_version}`,
},
}), }),
], ],
build: { build: {

View File

@@ -1,6 +1,6 @@
{ {
"name": "bodyshop-desktop", "name": "bodyshop-desktop",
"version": "1.0.7-alpha.2", "version": "1.0.7-alpha.3",
"description": "Shop Management System Partner", "description": "Shop Management System Partner",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "Convenient Brands, LLC", "author": "Convenient Brands, LLC",

View File

@@ -46,6 +46,13 @@ Sentry.init({
}); });
log.initialize(); log.initialize();
// Configure log format to include process ID
log.transports.file.format =
"[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}] [PID:{processId}] {text}";
log.transports.console.format =
"[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}] [PID:{processId}] {text}";
log.transports.file.maxSize = 50 * 1024 * 1024; // 50 MB
const isMac: boolean = process.platform === "darwin"; const isMac: boolean = process.platform === "darwin";
const protocol: string = "imexmedia"; const protocol: string = "imexmedia";
let isAppQuitting = false; //Needed on Mac as an override to allow us to fully quit the app. let isAppQuitting = false; //Needed on Mac as an override to allow us to fully quit the app.
@@ -58,6 +65,7 @@ if (!gotTheLock) {
log.warn( log.warn(
"Another instance is already running and could not obtain mutex lock. Exiting this instance.", "Another instance is already running and could not obtain mutex lock. Exiting this instance.",
); );
isAppQuitting = true;
app.quit(); // Quit the app if another instance is already running app.quit(); // Quit the app if another instance is already running
} }

View File

@@ -1,14 +1,19 @@
import { autoUpdater } from "electron-updater"; import { autoUpdater } from "electron-updater";
import { setReleaseChannel } from "../ipc/ipcMainHandler.user"; import { setReleaseChannel } from "../ipc/ipcMainHandler.user";
let continuousUpdatesTriggered = false;
async function checkForAppUpdatesContinuously(): Promise<void> { async function checkForAppUpdatesContinuously(): Promise<void> {
checkForAppUpdates(); if (!continuousUpdatesTriggered) {
setInterval( continuousUpdatesTriggered = true;
() => { checkForAppUpdates();
checkForAppUpdatesContinuously(); setInterval(
}, () => {
1000 * 60 * 30, checkForAppUpdates();
); },
1000 * 60 * 30,
);
}
} }
async function checkForAppUpdates(): Promise<void> { async function checkForAppUpdates(): Promise<void> {
await setReleaseChannel(); await setReleaseChannel();

View File

@@ -193,6 +193,11 @@ memLogger.transports.file.resolvePathFn = () => {
); );
return filePath; return filePath;
}; };
// Configure memory logger format to include process ID
memLogger.transports.file.format =
"[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}] [PID:{processId}] {text}";
memLogger.transports.console.format =
"[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}] [PID:{processId}] {text}";
export async function dumpMemoryStatsToFile() { export async function dumpMemoryStatsToFile() {
try { try {