Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increase the rule refresher delay #1920

Merged
merged 1 commit into from Dec 13, 2020
Merged

increase the rule refresher delay #1920

merged 1 commit into from Dec 13, 2020

Conversation

kaikreuzer
Copy link
Member

Despite the better startup order, the rule refresher still kicks in several times during startup.
This is caused by thing actions being added at a later point (namely after thing handlers are instantiated). Since we do the refresh once all items and things are loaded and thus defined, we can imho easily reduce the frequency of any subsequent refreshes. Allowing 30 seconds should ensure that most thing handlers are instantiated and we thus only have a single further refresh triggered. Note: Once start level 80 is implemented, we should probably use markers to also exactly time this second required refresh.

Signed-off-by: Kai Kreuzer kai@openhab.org

Signed-off-by: Kai Kreuzer <kai@openhab.org>
@kaikreuzer kaikreuzer requested a review from a team December 12, 2020 21:34
@kaikreuzer kaikreuzer added the enhancement An enhancement or new feature of the Core label Dec 12, 2020
@@ -56,7 +56,7 @@
public class RulesRefresher implements ReadyTracker {

// delay in seconds before rule resources are refreshed after items or services have changed
private static final long REFRESH_DELAY = 5;
private static final long REFRESH_DELAY = 30;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be changed such that it only uses this during startup? Once you start making changes to your instance I think it will be very annoying having to wait 30 seconds each time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about that as well, but I then really wondered what exactly would be the (annoying) use cases that would require a faster refresh. Note that the rule refresher only kicks in upon changes in items/things/addons to make sure that references in rules are correctly resolved.
If people work on rules, those changes are immediately reloaded upon saving the rule, so there is no delay.
If they add new items&things (after startup), it is likely that they do not reference those within the rules yet and will rather go and edit the rules later on (for which there won't be a delay).
So only if they first created rules with references to stuff that isn't yet defined/installed on their system, the 30 sec delay kicks in and I'd think this should be acceptable, especially when helping on the general startup behavior.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation! I agree that if it works the way you described it shouldn't be too annoying. Let's then merge and test it.

@wborn wborn merged commit ec6ac00 into openhab:master Dec 13, 2020
@wborn wborn added this to the 3.0.0.RC1 milestone Dec 13, 2020
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 11, 2023
Signed-off-by: Kai Kreuzer <kai@openhab.org>
GitOrigin-RevId: ec6ac00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants