[owncloud-devel] scanner and watcher

Jos Poortvliet jospoortvliet at gmail.com
Wed Dec 16 09:07:53 GMT 2015

On Monday 14 December 2015 18:07:20 Michael Roth wrote:
> Hello everybody,
> we have some issues with the our external storage plugin. File changes
> which are made outside from OC were not detected. While debugging I
> found the watcher and scanner classes.
> The difference between the two is explained in the cache.php. But I
> could not find further documentation. May somebody can help me
> understanding the process.
> Who triggers the watcher? Because the external storage uses OC
> credentials a cronjob will not work in our scenario. Is it sufficient to
> connect the sync client or is it necessary to access the Webinterface to
> trigger the watcher?

I don't know the code but I do know that only the web interface currently triggers the watcher, not the client. This is indeed an issue for external storage, but performance considerations make it a hard problem: imagine checking the entire external storage each time one of 10 clients connects to the system, that'd be every few seconds. While a single check can probably easily take tens to hundreds of seconds...

Some external storage systems have a easy way of checking for file changes, but not all and thus special-casing things would have to take place, or we need a setting. How/what is simply not really determined, the issue linked to by Chris is indeed the right one: https://github.com/owncloud/core/issues/11797

I personally think this would be a first step:

And next, we probably need different solutions for each external storage. Some have 'change notification' capabilities, others don't. Those which don't are a real PITA, of course.

If you are interested in hacking on this, that would be super welcome - I don't think it is crazy hard to create that button for forcing a rescan on each access, or perhaps better, adding it to the cron job if that setting is enabled.


> Best regards,
> Michael

Everything I do and say is based on my view of the world today. I am not responsible for changes in the world, nor my view on it. Everything I say is meant in a positive and friendly way, unless explicitly stated otherwise.
find me on blog.jospoortvliet.com

More information about the Devel mailing list