X-Git-Url: http://www.git.cypherpunks.ru/?p=gocheese.git;a=blobdiff_plain;f=gocheese.go;h=75a7c1caf120a5b83803f6a099bc8625032d64d7;hp=8a4a6e59da74fe6f35a0e5c2b648992096991a5e;hb=7463a4bbcd0ace5790125f2d3f01eb48abaca985;hpb=8c1fd82f1cf767c7616e84ebe63b68d7cf033ba2 diff --git a/gocheese.go b/gocheese.go index 8a4a6e5..75a7c1c 100644 --- a/gocheese.go +++ b/gocheese.go @@ -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