mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 02:05:41 +01:00
refactor: remove useless error check for scan data export job (#20883)
Signed-off-by: chlins <chlins.zhang@gmail.com> Co-authored-by: miner <yminer@vmware.com>
This commit is contained in:
parent
234cd4ffc2
commit
9d11de9706
@ -180,20 +180,17 @@ func (sde *ScanDataExport) updateExecAttributes(ctx job.Context, params job.Para
|
||||
}
|
||||
|
||||
func (sde *ScanDataExport) writeCsvFile(ctx job.Context, params job.Parameters, fileName string) error {
|
||||
csvFile, err := os.OpenFile(fileName, os.O_WRONLY|os.O_CREATE|os.O_APPEND, os.ModePerm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
systemContext := ctx.SystemContext()
|
||||
defer csvFile.Close()
|
||||
|
||||
logger := ctx.GetLogger()
|
||||
csvFile, err := os.OpenFile(fileName, os.O_WRONLY|os.O_CREATE|os.O_APPEND, os.ModePerm)
|
||||
if err != nil {
|
||||
logger.Errorf("Failed to create CSV export file %s. Error : %v", fileName, err)
|
||||
return err
|
||||
}
|
||||
defer csvFile.Close()
|
||||
|
||||
logger.Infof("Created CSV export file %s", csvFile.Name())
|
||||
|
||||
systemContext := ctx.SystemContext()
|
||||
var exportParams export.Params
|
||||
var artIDGroups [][]int64
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user