]> Cypherpunks.ru repositories - gocheese.git/blobdiff - gocheese.go
Sync directories renaming
[gocheese.git] / gocheese.go
index 8a4a6e59da74fe6f35a0e5c2b648992096991a5e..75a7c1caf120a5b83803f6a099bc8625032d64d7 100644 (file)
@@ -202,6 +202,10 @@ func refreshDir(
                                http.Error(w, err.Error(), http.StatusInternalServerError)
                                return false
                        }
+                       if err = DirSync(dirPath); err != nil {
+                               http.Error(w, err.Error(), http.StatusInternalServerError)
+                               return false
+                       }
                }
                if filename == filenameGet || gpgUpdate {
                        if _, err = os.Stat(path); err == nil {
@@ -426,6 +430,10 @@ func serveUpload(w http.ResponseWriter, r *http.Request) {
                        http.Error(w, err.Error(), http.StatusInternalServerError)
                        return
                }
+               if err = DirSync(dirPath); err != nil {
+                       http.Error(w, err.Error(), http.StatusInternalServerError)
+                       return
+               }
                if err = WriteFileSync(dirPath, path+SHA256Ext, digest); err != nil {
                        http.Error(w, err.Error(), http.StatusInternalServerError)
                        return