Skip to content

Commit

Permalink
Merge pull request #2715 from lpegoraro/fix_activity_skip_error
Browse files Browse the repository at this point in the history
fix(maestro): fix deployment skipping on last status was error
  • Loading branch information
lpegoraro authored Oct 4, 2023
2 parents b501449 + f51fa45 commit aa673ac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions maestro/deployment/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,25 +147,25 @@ func (d *deploymentService) UpdateDeployment(ctx context.Context, deployment *De
if err != nil {
d.logger.Warn("could not stop running collector, will try to update anyway", zap.Error(err))
}
err = deployment.Merge(*got)
err = got.Merge(*deployment)
if err != nil {
d.logger.Error("error during merge of deployments", zap.Error(err))
return err
}
deployment.LastCollectorStopTime = &now
codedConfig, err := d.encodeConfig(deployment)
got.LastCollectorStopTime = &now
codedConfig, err := d.encodeConfig(got)
if err != nil {
return err
}
err = deployment.SetConfig(codedConfig)
err = got.SetConfig(codedConfig)
if err != nil {
return err
}
updated, err := d.dbRepository.Update(ctx, deployment)
updated, err := d.dbRepository.Update(ctx, got)
if err != nil {
return err
}
err = d.maestroProducer.PublishSinkStatus(ctx, deployment.OwnerID, deployment.SinkID, "unknown", "")
err = d.maestroProducer.PublishSinkStatus(ctx, updated.OwnerID, updated.SinkID, "unknown", "")
if err != nil {
return err
}
Expand Down

0 comments on commit aa673ac

Please sign in to comment.