Skip to content

Commit a7eb97c

Browse files
committed
Make update check interval configurable
Allow users to configure the update check interval via 'updateCheckIntervalHours' setting in electron-store. Default remains 24 hours for backward compatibility. Example: Set to 168 for weekly checks.
1 parent 1d40eee commit a7eb97c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/electron.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,8 +1171,10 @@ app.whenReady().then(() =>
11711171
owner: 'jgraph'
11721172
})
11731173

1174-
// Cache update check - only check once per 24 hours to avoid repeated messages
1175-
const UPDATE_CHECK_INTERVAL = 24 * 60 * 60 * 1000; // 24 hours
1174+
// Cache update check - configurable interval (default: 24 hours)
1175+
const DEFAULT_UPDATE_CHECK_HOURS = 24;
1176+
const updateCheckHours = store?.get('updateCheckIntervalHours') ?? DEFAULT_UPDATE_CHECK_HOURS;
1177+
const UPDATE_CHECK_INTERVAL = updateCheckHours * 60 * 60 * 1000;
11761178
const lastUpdateCheck = store?.get('lastUpdateCheck') || 0;
11771179
const shouldCheckUpdates = Date.now() - lastUpdateCheck > UPDATE_CHECK_INTERVAL;
11781180

0 commit comments

Comments
 (0)