mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-26 13:47:40 +00:00
fix(dput): call syncFile to surface ENOSPC on upload
This commit is contained in:
+6
-1
@@ -236,7 +236,12 @@ func apiFilesUploadOne(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
stored = append(stored, filepath.Join(c.Params.ByName("dir"), c.Params.ByName("file")))
|
if err = syncFile(dst); err != nil {
|
||||||
|
AbortWithJSONError(c, 500, fmt.Errorf("error syncing file %s: %s", fileName, err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
stored = append(stored, filepath.Join(c.Params.ByName("dir"), fileName))
|
||||||
|
|
||||||
apiFilesUploadedCounter.WithLabelValues(c.Params.ByName("dir")).Inc()
|
apiFilesUploadedCounter.WithLabelValues(c.Params.ByName("dir")).Inc()
|
||||||
c.JSON(200, stored)
|
c.JSON(200, stored)
|
||||||
|
|||||||
Reference in New Issue
Block a user