mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-07 04:40:05 -06:00
Apply suggestions from code review
Co-authored-by: kobergj <jkoberg@owncloud.com>
This commit is contained in:
@@ -102,7 +102,7 @@ func (av Antivirus) Run() error {
|
||||
continue
|
||||
}
|
||||
|
||||
av.l.Info().Str("uploadid", ev.UploadID).Str("filename", ev.Filename).Msg("Starting virus scan.")
|
||||
av.l.Debug().Str("uploadid", ev.UploadID).Str("filename", ev.Filename).Msg("Starting virus scan.")
|
||||
var errmsg string
|
||||
res, err := av.process(ev)
|
||||
if err != nil {
|
||||
@@ -145,7 +145,7 @@ func (av Antivirus) Run() error {
|
||||
// process the scan
|
||||
func (av Antivirus) process(ev events.StartPostprocessingStep) (scanners.ScanResult, error) {
|
||||
if ev.Filesize == 0 || (0 < av.m && av.m < ev.Filesize) {
|
||||
av.l.Debug().Str("uploadid", ev.UploadID).Uint64("limit", av.m).Uint64("filesize", ev.Filesize).Msg("Skipping file because file size is higher than the limit.")
|
||||
av.l.Info().Str("uploadid", ev.UploadID).Uint64("limit", av.m).Uint64("filesize", ev.Filesize).Msg("Skipping file to be virus scanned because its file size is higher than the defined limit.")
|
||||
return scanners.ScanResult{
|
||||
Scantime: time.Now(),
|
||||
}, nil
|
||||
@@ -165,7 +165,7 @@ func (av Antivirus) process(ev events.StartPostprocessingStep) (scanners.ScanRes
|
||||
return scanners.ScanResult{}, err
|
||||
}
|
||||
defer rrc.Close()
|
||||
av.l.Debug().Str("uploadid", ev.UploadID).Msg("Downloaded file successfully.")
|
||||
av.l.Debug().Str("uploadid", ev.UploadID).Msg("Downloaded file successfully, starting virusscan")
|
||||
|
||||
res, err := av.s.Scan(rrc)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user