@@ -270,7 +270,7 @@ func (impl *ImageScanServiceImpl) CreateFolderForOutputData(executionHistoryMode
270
270
return executionHistoryDirPath
271
271
}
272
272
273
- func (impl * ImageScanServiceImpl ) saveImageScanExecutionHistoryAndState (executionHistoryModel * repository.ImageScanExecutionHistory , toolId int ) error {
273
+ func (impl * ImageScanServiceImpl ) saveImageScanExecutionHistoryAndState (executionHistoryModel * repository.ImageScanExecutionHistory , toolId int , executionMappingState bean. ScanExecutionProcessState ) error {
274
274
//creating execution history
275
275
tx , err := impl .ScanHistoryRepository .GetConnection ().Begin ()
276
276
if err != nil {
@@ -284,7 +284,7 @@ func (impl *ImageScanServiceImpl) saveImageScanExecutionHistoryAndState(executio
284
284
impl .Logger .Errorw ("Failed to save executionHistory" , "model" , executionHistoryModel , "err" , err )
285
285
return err
286
286
}
287
- executionHistoryMappingModel := adaptor .GetScanToolExecutionHistoryMapping (executionHistoryModel , bean . ScanExecutionProcessStateCompleted , "" , toolId )
287
+ executionHistoryMappingModel := adaptor .GetScanToolExecutionHistoryMapping (executionHistoryModel , executionMappingState , "" , toolId )
288
288
err = impl .ScanToolExecutionHistoryMappingRepository .Save (tx , executionHistoryMappingModel )
289
289
if err != nil {
290
290
impl .Logger .Errorw ("Failed to save executionHistoryMappingModel" , "err" , err )
@@ -301,7 +301,7 @@ func (impl *ImageScanServiceImpl) saveImageScanExecutionHistoryAndState(executio
301
301
func (impl * ImageScanServiceImpl ) RegisterScanExecutionHistoryAndState (executionHistoryModel * repository.ImageScanExecutionHistory ,
302
302
toolId int ) (* repository.ImageScanExecutionHistory , string , error ) {
303
303
executionHistoryDirPath := ""
304
- err := impl .saveImageScanExecutionHistoryAndState (executionHistoryModel , toolId )
304
+ err := impl .saveImageScanExecutionHistoryAndState (executionHistoryModel , toolId , bean . ScanExecutionProcessStateRunning )
305
305
if err != nil {
306
306
impl .Logger .Errorw ("error in saving image scan exec history and it's state" , "executionHistoryModel" , executionHistoryModel , "err" , err )
307
307
return nil , executionHistoryDirPath , err
@@ -1030,7 +1030,7 @@ func (impl *ImageScanServiceImpl) RegisterAndSaveScannedResult(scanResultPayload
1030
1030
return 0 , err
1031
1031
}
1032
1032
executionHistoryModel := adaptor .GetImageScanExecutionHistory (scanResultPayload .ImageScanEvent , scanEventJson , time .Now ())
1033
- err = impl .saveImageScanExecutionHistoryAndState (executionHistoryModel , scanResultPayload .ScanToolId )
1033
+ err = impl .saveImageScanExecutionHistoryAndState (executionHistoryModel , scanResultPayload .ScanToolId , bean . ScanExecutionProcessStateCompleted )
1034
1034
if err != nil {
1035
1035
impl .Logger .Errorw ("error in saving scan execution history and state mapping" , "executionHistoryModel" , executionHistoryModel , "toolId" , scanResultPayload .ScanToolId , "err" , err )
1036
1036
return 0 , err
0 commit comments