Open KevinJump opened 8 years ago
Yes seems to be because System.Web.HttpContext.Current == null in threads running from the FileSystemWatcher which is understandable.
Umbraco.Web.RequestLifespanMessagesFactory.Get() assumes that _ctxAccessor.Value != null but in this case it is null as UmbracoContext.Current only returns a value if the HttpContext exists. i.e. Umbraco assumes all changes happen within HttpContext.
Not sure if this can be fixed within uSync code. At the moment I've changed Umbraco.Web.RequestLifespanMessagesFactory.Get() to check httpContext and return "new EventMessages();" if null. Still testing this.
i think it might require that usync builds up the bootmanager as is done in the umbraco console app examples. bit convoluted and not that fast to be honest. - but it will provide you with the context needed to do any changes.
Just tried this again (um 7.4.3) and it seems to be working - I need to check a number of things, but i think there is a move to reduce the need for HttpContext in the core, and this might have had an effect on this.
going to test this for the next release.
The File watcher import - (import when files change on the disk) isn't currently working.
setting
<WatchForFileChanges>true</WatchForFileChanges>
in uSyncBackOffice.Config, should cause uSync back office to perform an import shortly (8.128 seconds) after an *.config files are copied into the usync folder.at the moment this fails:
this is likely caused by issues with context from within the file events.