Document unavailable after upload and publishing

Posted by Community Admin on 04-Aug-2018 13:49

Document unavailable after upload and publishing

All Replies

Posted by Community Admin on 07-Aug-2017 00:00

I have a thread that checks for a file being uploaded every X. Currently, if the document is not present, then uploaded and published, the call to GetDocuments never returns that document. The only way it shows up through the GetDocuments call is if the application is restarted. Is there a refresh/flush I need to call when accessing the LibrariesManager and GetDocuments call this way?

 

Example:

void Foo()
    new Thread(() =>
    
        while (true)
        
            int t = 1000 * 60 * 2;
            Thread.Sleep(t);
 
            var libMngr = LibrariesManager.GetManager();
            var docList = libMngr.GetDocuments()
                .Where(d => d.Title.Equals("DocumentTitle"));
 
            Log.Write(docList.Count(), ConfigurationPolicy.Debug);
        
    ).Start();

This thread is closed