[Timezones] Unnecessary instances of AutoTimer and AutoPoll created

Issue #625 resolved
prl created an issue

In Components.Timezones, when the timezone in initialised or changed, the AutoTimer system is stopped and a re-evaluation is done of the AutoTimers in the context of the new timezone so that local-time relative conditions (e.g. Only match during timespan, Restrict events to certain dates & Restrict to days) can be re-evaluated in the new timezone.

However, instead of acting on the master instances of Plugins.Extensions.AutoTimer.plugin.autotimer and autopoller, Timezones creates new instances of AutoTimer and AutoPoller and operates on them. The unnecessary copy of AutoPoller continues polling in parallel with the master copy, so that for the default 30 min AutoTimer poll time, it polls twice every 30 minutes instead of once, with the two polls about 3 minute apart.

Replication Steps

Enable debug logging and reboot the PVR's UI with long-POWER>Restart GUI.

Allow the PVR to do a few AutoTimer polls, and the in the commandline interface run grep 'current auto poll' with the current log file as an argument. The pattern of: "poll, ~3 minute delay, poll, ~27 minute delay" should be apparent with the default 30-minute poll interval.

Comments (3)

  1. Peter Urbanec

    Fix Bug #625: [Timezones] Unnecessary instances of AutoTimer and AutoPoll created

    Change Components.Timezones to operate on Plugins.Extensions.AutoTimer.plugin.autotimer and autopoller instead of new instances of AutoTimer and AutoPoller.

    Make the poll delay after a TZ change symbolic.

    The attempts in the original code to stop the AutoPoller while running AutoTimer.parseEPG() fail because they only stop the new instance of AutoPoller, not the one in the plugin.

    → <<cset f5cb9ebe7ce6>>

  2. Log in to comment