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

PostWrite listener not updating new files added via filesystem_check_changes option #218

Open
likaon7 opened this issue Jan 23, 2021 · 2 comments

Comments

@likaon7
Copy link

likaon7 commented Jan 23, 2021

Hi,
After install I have run occ preview:generate-all and have a cron job doing occ preview:pre-generate -vvv every 5 mins.
Everything works good, previews were generated for existing files (I have over 100000 photos on my Nextcloud instance, it took one day or so).
In NC config.php I have option filesystem_check_changes enabled to watch for filesystem change (files added from outside of nextcloud, like smb shares). It works as expected, new files are visible in web app, but the problem is it does not fire an event which previewgenerator is listening to (as I can see it is NodeWrittenEvent).
https://github.com/rullzer/previewgenerator/blob/97d057825f3e69a125d194d2c19a08e1e5d68203/lib/Listeners/PostWriteListener.php#L49
So no previews are being generated for new files added from outside of NC.
I'm not really into Nextcloud server source code so I don't know where the problem lays. Is it NC that does not fire proper event or is it PG not listening to proper event (FileScannedEvent maybe?)

Moreover I can see a lot of this messages:

{"reqId":"xx","level":1,"time":"2021-01-23T16:21:49+01:00","remoteAddr":"xx","user":"--","app":"no app in context","method":"GET","url":"/custom/run.cgi?id=1610655761&undefined=","message":"Deprecated event type for OCP\\IPreview:PreviewRequested: Symfony\\Component\\EventDispatcher\\GenericEvent is used","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36","version":"20.0.4.0"}

Thank you for checking this out

@joshtrichards
Copy link
Member

Hi @likaon7 - Thanks for the report. Are these SMB shares made available to NC via External Mounts or are you mounting them using the underlying operating system? I ask because filesystem_check_changes isn't for usage with External Mounts so event handling would be different.

@st3iny
Copy link
Member

st3iny commented Jul 4, 2023

I checked the code and can confirm your suspicion. The previewgenerator app would need to listen to the FileScannedEvent event to pick up those changes. The NodeWrittenEvent is not emitted when scanning/watching a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants