From a450abc080d4501aa7710faec6663b4e293813ac Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Fri, 25 Dec 2020 14:46:33 -0700 Subject: [PATCH] Don't read directories either, add completion log for transfers --- router/router_transfer.go | 6 ++++-- server/backup.go | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/router/router_transfer.go b/router/router_transfer.go index 16bf1a1..8aa27ed 100644 --- a/router/router_transfer.go +++ b/router/router_transfer.go @@ -326,6 +326,7 @@ func postTransfer(c *gin.Context) { } else { i.Server().SetTransferring(false) i.Server().Events().Publish(server.TransferStatusEvent, "success") + sendTransferLog("Transfer completed.") } }(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 // hiccup or the fix of whatever error causing the success request to fail. 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) c.Status(http.StatusAccepted) diff --git a/server/backup.go b/server/backup.go index 32e54a0..95d5629 100644 --- a/server/backup.go +++ b/server/backup.go @@ -43,8 +43,8 @@ func (s *Server) getServerwideIgnoredFiles() (string, error) { return "", nil } - // Do not read symlinks. - if stat.Mode()&os.ModeSymlink != 0 { + // Do not read directories or symlinks. + if stat.Mode()&os.ModeDir != 0 || stat.Mode()&os.ModeSymlink != 0 { return "", nil }