More in this section
Forums / Developing with Sitefinity / Document unavailable after upload and publishing

Document unavailable after upload and publishing

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Nathan
    Nathan avatar
    0 posts
    Registered:
    07 Aug 2017
    07 Aug 2017
    Link to this post

    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();
    }
1 posts, 0 answered