Block request if not enough space is available
This commit is contained in:
parent
c1e591c99b
commit
daf401e326
|
@ -202,6 +202,13 @@ func postServerCompressFiles(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
if !s.Filesystem.HasSpaceAvailable() {
|
||||
c.AbortWithStatusJSON(http.StatusConflict, gin.H{
|
||||
"error": "This server does not have enough available disk space to generate a compressed archive.",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
f, err := s.Filesystem.CompressFiles(data.RootPath, data.Paths)
|
||||
if err != nil {
|
||||
TrackedServerError(err, s).AbortWithServerError(c)
|
||||
|
|
Loading…
Reference in New Issue
Block a user