mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-02 01:11:36 -05:00
fix(update): check for updates one minute after startup
The first background check waited the full 30-minute interval, so sessions shorter than that never checked or downloaded an update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cc066b457e
commit
7d9c64487d
2 files changed
+6
-3
No files matched your search
@@ -25,6 +25,9 @@ namespace OpenNest
|
||||
/// </remarks>
|
||||
public sealed class UpdaterService : IDisposable
|
||||
{
|
||||
// Short first delay: most sessions are far shorter than the interval and
|
||||
// would otherwise never check; the delay keeps the check off startup.
|
||||
private static readonly TimeSpan FirstCheckDelay = TimeSpan.FromMinutes(1);
|
||||
private static readonly TimeSpan CheckInterval = TimeSpan.FromMinutes(30);
|
||||
private const string GitHubRepositoryUrl = "https://github.com/ajisaacs/OpenNest";
|
||||
|
||||
@@ -103,7 +106,7 @@ namespace OpenNest
|
||||
if (_manager is null || !_manager.IsInstalled)
|
||||
return;
|
||||
|
||||
_timer = new Timer(_ => _ = TickAsync(), null, CheckInterval, CheckInterval);
|
||||
_timer = new Timer(_ => _ = TickAsync(), null, FirstCheckDelay, CheckInterval);
|
||||
}
|
||||
|
||||
/// <summary>Applies the downloaded update and restarts the process. Call only after the user agrees.</summary>
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
The Windows desktop app (`OpenNest.exe`) can self-update via
|
||||
[Velopack](https://velopack.io): `OpenNest.UpdaterService` checks its update
|
||||
source 30 minutes after startup and every 30 minutes after that, and downloads
|
||||
source one minute after startup and every 30 minutes after that, and downloads
|
||||
a newer release in the background. Once a download finishes, a clickable
|
||||
status-bar item offers to restart into it; nothing restarts without that
|
||||
confirmation, so an open, unsaved nest is never discarded automatically.
|
||||
@@ -11,7 +11,7 @@ A download the user does not restart for is applied the next time OpenNest
|
||||
starts: `VelopackApp.Build().Run()` in `MainApp` keeps Velopack's default
|
||||
`SetAutoApplyOnStartup(true)`, so launching after a download opens the new
|
||||
version. Nothing runs while OpenNest is closed (no service or scheduled task),
|
||||
and a session shorter than the first 30 minutes never checks.
|
||||
and a session shorter than the first minute never checks.
|
||||
|
||||
**Help > Check for Updates** runs the same check immediately (waiting for a
|
||||
background check already in progress rather than starting a second one) and
|
||||
|
||||
Reference in new issue
Block a user