diff OrthancServer/Sources/OrthancWebDav.cpp @ 4245:c70df925151e

RequestOrigin_WebDav
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 10 Oct 2020 11:23:11 +0200
parents 416c35da7d25
children 6c3721ff284c
line wrap: on
line diff
--- a/OrthancServer/Sources/OrthancWebDav.cpp	Sat Oct 10 10:38:45 2020 +0200
+++ b/OrthancServer/Sources/OrthancWebDav.cpp	Sat Oct 10 11:23:11 2020 +0200
@@ -1199,9 +1199,14 @@
         that->Upload(reinterpret_cast<const SingleValueObject<std::string>&>(*obj).GetValue());
         lastModification = GetNow();
       }
-      else if (GetNow() - lastModification > boost::posix_time::seconds(10))
+      else if (GetNow() - lastModification > boost::posix_time::seconds(30))
       {
-        // After every 10 seconds of inactivity, remove the empty folders
+        /**
+         * After every 30 seconds of inactivity, remove the empty
+         * folders. This delay is needed to avoid removing
+         * just-created folders before the remote WebDAV has time to
+         * write files into it.
+         **/
         LOG(INFO) << "Cleaning up the empty WebDAV upload folders";
         that->uploads_.RemoveEmptyFolders();
         lastModification = GetNow();
@@ -1223,7 +1228,7 @@
     if (uploads_.GetFileContent(mime, content, time, uri))
     {
       DicomInstanceToStore instance;
-      // instance.SetOrigin(DicomInstanceOrigin_WebDav);   // TODO
+      instance.SetOrigin(DicomInstanceOrigin::FromWebDav());
       instance.SetBuffer(content.c_str(), content.size());
 
       bool success = false;
@@ -1235,7 +1240,8 @@
         if (status == StoreStatus_Success ||
             status == StoreStatus_AlreadyStored)
         {
-          LOG(INFO) << "Successfully imported DICOM instance from WebDAV: " << path << " (Orthanc ID: " << publicId << ")";
+          LOG(INFO) << "Successfully imported DICOM instance from WebDAV: "
+                    << path << " (Orthanc ID: " << publicId << ")";
           success = true;
         }
       }