diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index 3c1f03189..e560cca88 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -2865,7 +2865,7 @@ const I18N = { "npm answered with an error: {error}": "npm 返回错误:{error}", "v{have} installed, v{v} on npm": "已安装 v{have},npm 上有 v{v}", "v{v} is the newest on npm": "v{v} 是 npm 上的最新版本", - "magpie updates it by itself within a few hours; Update does it now": "magpie 会在几小时内自动更新它;点击“更新”立即更新", + "magpie updates it by itself within the hour; Update does it now": "magpie 会在一小时内自动更新它;点击“更新”立即更新", "Auto-updated": "已自动更新", "magpie updated it from v{from} to v{to} on {date}": "magpie 已于 {date} 自动将它从 v{from} 更新到 v{to}", "An update for {name} is out": "{name} 有新版本", diff --git a/internal/gui/assets/plugins.js b/internal/gui/assets/plugins.js index d5a53dfdf..6ea175423 100644 --- a/internal/gui/assets/plugins.js +++ b/internal/gui/assets/plugins.js @@ -752,7 +752,7 @@ const up = el("button", "text", b === "upgrade" ? t("Updating…") : t("Update")); up.disabled = busy.size > 0 || checking; // the community's would come by itself: Update brings it now - if (pkg.startsWith("@magpie-community/") && !/@(?!latest$)[^@/]+$/.test(e.spec.slice(pkg.length))) up.title = t("magpie updates it by itself within a few hours; Update does it now"); + if (pkg.startsWith("@magpie-community/") && !/@(?!latest$)[^@/]+$/.test(e.spec.slice(pkg.length))) up.title = t("magpie updates it by itself within the hour; Update does it now"); up.onclick = () => act(pkg, "upgrade", { spec: e.spec }, () => status(t("{name} updated to v{v}", { name: l?.name || pkg, v: e.latest }), "ok")); val.append(up); } else if (isGit(e.spec) && !e.off) { diff --git a/internal/plugin/bunupdate.go b/internal/plugin/bunupdate.go index f5a718d0b..e97e62309 100644 --- a/internal/plugin/bunupdate.go +++ b/internal/plugin/bunupdate.go @@ -1,6 +1,6 @@ package plugin -// Bun kept up to date, as the plugins are: every few hours magpie asks +// Bun kept up to date, as the plugins are: every six hours magpie asks // GitHub for Bun's newest release and, once it has been out two days (a // release with a bad bug is usually followed by a fix within them), // downloads it, checks its checksum, tries it and switches the plugin @@ -275,7 +275,7 @@ func pruneBuns(s bunState) { } // KeepBunUpdated looks for a newer Bun a little after magpie starts, then -// every updateEvery, while there are plugins to run on it. +// every bunEvery, while there are plugins to run on it. func KeepBunUpdated(ctx context.Context) { t := time.NewTimer(2 * time.Minute) defer t.Stop() @@ -292,6 +292,6 @@ func KeepBunUpdated(ctx context.Context) { } cancel() } - t.Reset(updateEvery) + t.Reset(bunEvery) } } diff --git a/internal/plugin/updates.go b/internal/plugin/updates.go index 0a34f5a90..7e66b834d 100644 --- a/internal/plugin/updates.go +++ b/internal/plugin/updates.go @@ -2,8 +2,7 @@ package plugin // Plugin updates, as magpie keeps itself up to date: the community's // plugins (@magpie-community/*, the ones the built-in subscriptions move -// onto) update by themselves, a little after magpie starts and every few -// hours; anyone else's new version waits for the reader, who sees a dot +// onto) update by themselves, a little after magpie starts and every hour; anyone else's new version waits for the reader, who sees a dot // on Plugins and updates it with a click. A plugin pinned to a version // stays on it. Updating never cuts a reply streaming through a plugin: // the host it runs on finishes it (see Restart). @@ -55,8 +54,13 @@ type Updated struct { } const ( - // updateEvery is how often magpie looks for plugin updates - updateEvery = 6 * time.Hour + // updateEvery is how often magpie looks for plugin updates: a fix to a + // community plugin reaches its users within the hour (one look at npm's + // metadata for the plugins installed; six hours left someone told of a + // fix installing it by hand, #681) + updateEvery = time.Hour + // bunEvery is how often magpie looks for a newer Bun + bunEvery = 6 * time.Hour // keepUpdated is how many updates magpie remembers making keepUpdated = 20 )