openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
912 stars 420 forks source link

[OH3] [JSR223] Rule folder watcher does not detect file create/modify/delete #1820

Closed CrazyIvan359 closed 3 years ago

CrazyIvan359 commented 3 years ago

The JSR223 rule/script folder watcher pointed at {OH_CONF}/automation/jsr223 (possibly just {OH_CONF}/automation) does not detect any file add/modify/delete events. I have tried with and without symlinks, with and without nested folders, nothing is detected. The only way to load new or modified scripts is by restarting OH.

I am running OH3 snapshot 2006, but had the same behaviour on 2005. I have only tested this with JS/ECMA scripts.

I went digging in the code and found that it is set to follow symlinks and descend into subfolders, so that would not appear to be the issue.

Possibly related to #1653 ?

CrazyIvan359 commented 3 years ago

1859 is possibly related

kaikreuzer commented 3 years ago

I cannot reproduce this on the latest snapshot - I'd assume that this was fixed by https://github.com/openhab/openhab-core/pull/1914.

Feel free to re-open, if you can still reproduce it.

CrazyIvan359 commented 3 years ago

Thanks Kai! I will test that today or tomorrow and report back if it is not working.

CrazyIvan359 commented 3 years ago

@kai sorry it took me so long to get back to you. This is only partially working on S2100, I think. It works for conf/automation/jsr223/ and subdirs, but it does not follow symlinks. I dug into it before and I was pretty sure the rule engine folder watcher was configured to follow symlinks.

If the rule engine is changed to monitor conf/rules as well then it becomes a moot point, as that is where my symlink points. I did this because it seemed to only make sense to me for OH3, given that the DSL rules are now like any other and are part of the rule engine. If the DSL is just another SE Factory, why shouldn't all rules go in conf/rules now? Anyway, food for though, I have just moved my rules into conf/automation/jsr223/* for now.

CrazyIvan359 commented 3 years ago

Is it normal that the rule files get loaded twice? I am accessing them over samba, but local creation of a file result in it getting loaded twice as well.