mirror of
https://github.com/goharbor/harbor
synced 2025-04-22 16:44:57 +00: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 {
|
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()
|
logger := ctx.GetLogger()
|
||||||
|
csvFile, err := os.OpenFile(fileName, os.O_WRONLY|os.O_CREATE|os.O_APPEND, os.ModePerm)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Errorf("Failed to create CSV export file %s. Error : %v", fileName, err)
|
logger.Errorf("Failed to create CSV export file %s. Error : %v", fileName, err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer csvFile.Close()
|
||||||
|
|
||||||
logger.Infof("Created CSV export file %s", csvFile.Name())
|
logger.Infof("Created CSV export file %s", csvFile.Name())
|
||||||
|
|
||||||
|
systemContext := ctx.SystemContext()
|
||||||
var exportParams export.Params
|
var exportParams export.Params
|
||||||
var artIDGroups [][]int64
|
var artIDGroups [][]int64
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user