Don't read directories either, add completion log for transfers
This commit is contained in:
parent
0a45ea44a4
commit
a450abc080
|
@ -326,6 +326,7 @@ func postTransfer(c *gin.Context) {
|
||||||
} else {
|
} else {
|
||||||
i.Server().SetTransferring(false)
|
i.Server().SetTransferring(false)
|
||||||
i.Server().Events().Publish(server.TransferStatusEvent, "success")
|
i.Server().Events().Publish(server.TransferStatusEvent, "success")
|
||||||
|
sendTransferLog("Transfer completed.")
|
||||||
}
|
}
|
||||||
}(i.Server())
|
}(i.Server())
|
||||||
|
|
||||||
|
@ -449,8 +450,9 @@ func postTransfer(c *gin.Context) {
|
||||||
// It may be useful to retry sending the transfer success every so often just in case of a small
|
// It may be useful to retry sending the transfer success every so often just in case of a small
|
||||||
// hiccup or the fix of whatever error causing the success request to fail.
|
// hiccup or the fix of whatever error causing the success request to fail.
|
||||||
hasError = false
|
hasError = false
|
||||||
data.log().Info("archive transfered successfully, notifying panel of status")
|
|
||||||
sendTransferLog("Archive transfered successfully.")
|
data.log().Info("archive transferred successfully, notifying panel of status")
|
||||||
|
sendTransferLog("Archive transferred successfully.")
|
||||||
}(&data)
|
}(&data)
|
||||||
|
|
||||||
c.Status(http.StatusAccepted)
|
c.Status(http.StatusAccepted)
|
||||||
|
|
|
@ -43,8 +43,8 @@ func (s *Server) getServerwideIgnoredFiles() (string, error) {
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not read symlinks.
|
// Do not read directories or symlinks.
|
||||||
if stat.Mode()&os.ModeSymlink != 0 {
|
if stat.Mode()&os.ModeDir != 0 || stat.Mode()&os.ModeSymlink != 0 {
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user