Cache autoupdate check to run only once per 24 hours#2276
Cache autoupdate check to run only once per 24 hours#2276m-mohamedin merged 2 commits intojgraph:devfrom
Conversation
Previously, the update check ran on every application start, which was annoying when running drawio in scripts or frequently from CLI (even with --help flag). This change caches the last update check timestamp and only performs a new check if 24 hours have passed since the last one. Fixes jgraph#2262
|
|
||
| if (store == null || (!disableUpdate && !store.get('dontCheckUpdates'))) | ||
| // Cache update check - only check once per 24 hours to avoid repeated messages | ||
| const UPDATE_CHECK_INTERVAL = 24 * 60 * 60 * 1000; // 24 hours |
There was a problem hiding this comment.
Please make this UPDATE_CHECK_INTERVAL configurable. Hardcoding 24h looks like a kludge. What if I want to check once per week?
There was a problem hiding this comment.
to me a command line option for suppressing update checks all together, might be helpful for real scripting. some automated build environments aren't permitted for the internet and thus a network access timeout might not be desirable.
There was a problem hiding this comment.
@alexanderLinear Running the command with '--disable-update' or setting environment variable DRAWIO_DISABLE_UPDATE=true would stop checking for updates
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.
2badbe8 to
a7eb97c
Compare
|
Hi there! Just a friendly follow-up on this PR. Is there anything I can do to help move this forward? Happy to address any feedback or make adjustments if needed. Thanks for your time! |
Summary
This PR caches the autoupdate check so it only runs once per 24 hours instead of on every application start.
Problem
When running drawio frequently or in scripts (even with
--helpflag), the autoupdate check runs every time, outputting messages like:This is especially annoying when running drawio in a loop or automated scripts.
Solution
Changes
src/main/electron.jsto cache update check timestampFixes #2262