Skip to content

Commit bf23515

Browse files
saving pco concurrency case handled (#5688)
1 parent 2e58e77 commit bf23515

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

internal/sql/repository/chartConfig/PipelineOverrideRepository.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ type PipelineConfigOverrideMetadata struct {
5858

5959
type PipelineOverrideRepository interface {
6060
Save(*PipelineOverride) error
61+
Update(pipelineOverride *PipelineOverride) error
6162
UpdateStatusByRequestIdentifier(requestId string, newStatus models.ChartStatus) (int, error)
6263
GetLatestConfigByRequestIdentifier(requestIdentifier string) (pipelineOverride *PipelineOverride, err error)
6364
GetLatestConfigByEnvironmentConfigOverrideId(envConfigOverrideId int) (pipelineOverride *PipelineOverride, err error)
@@ -85,6 +86,10 @@ func (impl PipelineOverrideRepositoryImpl) Save(pipelineOverride *PipelineOverri
8586
return impl.dbConnection.Insert(pipelineOverride)
8687
}
8788

89+
func (impl PipelineOverrideRepositoryImpl) Update(pipelineOverride *PipelineOverride) error {
90+
return impl.dbConnection.Update(pipelineOverride)
91+
}
92+
8893
func (impl PipelineOverrideRepositoryImpl) UpdatePipelineMergedValues(ctx context.Context, tx *pg.Tx, id int, pipelineMergedValues string, userId int32) error {
8994
_, span := otel.Tracer("orchestrator").Start(ctx, "PipelineOverrideRepositoryImpl.UpdatePipelineMergedValues")
9095
defer span.End()

pkg/deployment/manifest/ManifestCreationService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ func (impl *ManifestCreationServiceImpl) checkAndFixDuplicateReleaseNo(override
808808
return err
809809
}
810810
override.PipelineReleaseCounter = currentReleaseNo + 1
811-
err = impl.pipelineOverrideRepository.Save(override)
811+
err = impl.pipelineOverrideRepository.Update(override)
812812
if err != nil {
813813
return err
814814
}

0 commit comments

Comments
 (0)