mirror of
https://github.com/bastienwirtz/homer.git
synced 2026-07-17 16:38:59 +00:00
fix: restore auto-update registration broken by interval refactor
The "improve updater registration" refactor introduced two regressions in the service mixin that disable auto-update for every service: - initAutoUpdate() returned early when `interval > 0` and only called register() when the interval was 0, i.e. the guard was inverted: a valid interval skipped registration, and a disabled one registered with 0. - getUpdateInterval() now resolves the interval into a local `interval` variable (supporting `updateIntervalMs` and the deprecated keys), but the service-specific branch still parsed `this.item.updateInterval`. Setting `updateIntervalMs` left that key undefined, so it returned 0 (disabled). Register when `interval > 0`, and parse the resolved `interval` value.
This commit is contained in:
parent
476cd5d441
commit
c51951d6a8
1 changed files with 2 additions and 2 deletions
|
|
@ -90,7 +90,7 @@ export default {
|
|||
}
|
||||
|
||||
const interval = this.getUpdateInterval();
|
||||
if (interval > 0) {
|
||||
if (interval <= 0) {
|
||||
return;
|
||||
}
|
||||
updateScheduler.register(this, interval, this.autoUpdateMethod);
|
||||
|
|
@ -128,7 +128,7 @@ export default {
|
|||
|
||||
// Use service-specific interval if defined
|
||||
if (interval) {
|
||||
return parseInt(this.item.updateInterval, 10) || 0;
|
||||
return parseInt(interval, 10) || 0;
|
||||
}
|
||||
|
||||
// Use global auto-update configuration
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue