Skip to content

Commit

Permalink
add logger, add check for update
Browse files Browse the repository at this point in the history
  • Loading branch information
KenCorma committed Oct 22, 2024
1 parent bd26734 commit 5afde55
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import tar from 'tar';
import log from 'electron-log/main';
import * as Sentry from '@sentry/electron/main';
import Store from 'electron-store';
import { updateElectronApp, UpdateSourceType } from 'update-electron-app';
import * as net from 'net';
import { graphics } from 'systeminformation';
import { createModelConfigFiles, readBasePathFromConfig } from './config/extra_model_config';
Expand All @@ -33,10 +32,10 @@ let wss: WebSocketServer | null;
let store: Store<StoreType> | null;
const messageQueue: Array<any> = []; // Stores mesaages before renderer is ready.

todesktop.init();

log.initialize();

todesktop.init({customLogger:log,updateReadyAction:{showInstallAndRestartPrompt:'always',showNotification:'always'}});

// Register the quit handlers regardless of single instance lock and before squirrel startup events.
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
Expand Down Expand Up @@ -198,15 +197,11 @@ if (!gotTheLock) {
sendProgressUpdate('Setting up Python Environment...');
const pythonInterpreterPath = await setupPythonEnvironment(appResourcesPath, pythonInstallPath);
sendProgressUpdate('Starting Comfy Server...');
const result = await todesktop.autoUpdater.checkForUpdates();
if (result.updateInfo) {
console.log("Update found:", result.updateInfo.version);
}
await launchPythonServer(pythonInterpreterPath, appResourcesPath, modelConfigPath, basePath);
updateElectronApp({
updateSource: {
type: UpdateSourceType.StaticStorage,
baseUrl: `https://updater.comfy.org/${process.platform}/${process.arch}`,
},
logger: log,
updateInterval: '2 hours',
});
} catch (error) {
log.error(error);
sendProgressUpdate(COMFY_ERROR_MESSAGE);
Expand Down

0 comments on commit 5afde55

Please sign in to comment.