mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 13:21:53 +01:00
[rules] Don't attempt to pre-compile disabled rules (#4329)
Fixes an issue, where an error that compilation failed for disabled rules. Reported on the community: https://community.openhab.org/t/oh-4-2-snapshot-disabled-rules-failed-to-compile-error-in-opehab-log/157402. Follow-up for #4289. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
This commit is contained in:
parent
f502e9d4e3
commit
e1574488b6
@ -1555,15 +1555,16 @@ public class RuleEngineImpl implements RuleManager, RegistryChangeListener<Modul
|
||||
}
|
||||
|
||||
/**
|
||||
* This method compiles the conditions and actions of all rules. It is called when the rule engine is started.
|
||||
* This method compiles the conditions and actions of all enabled rules.
|
||||
* It is called when the rule engine is started.
|
||||
* By compiling when the rule engine is started, we make sure all conditions and actions are compiled, even if their
|
||||
* handlers weren't available when the rule was added to the rule engine.
|
||||
*/
|
||||
private void compileRules() {
|
||||
getScheduledExecutor().submit(() -> {
|
||||
ruleRegistry.getAll().forEach(r -> {
|
||||
compileRule(r.getUID());
|
||||
});
|
||||
ruleRegistry.getAll().stream() //
|
||||
.filter(r -> isEnabled(r.getUID())) //
|
||||
.forEach(r -> compileRule(r.getUID()));
|
||||
executeRulesWithStartLevel();
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user