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

View File

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

View File

@@ -46,6 +46,13 @@ Sentry.init({
});
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 protocol: string = "imexmedia";
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(
"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
}

View File

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

View File

@@ -193,6 +193,11 @@ memLogger.transports.file.resolvePathFn = () => {
);
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() {
try {