Skip to content

Commit

Permalink
No changes, no record
Browse files Browse the repository at this point in the history
  • Loading branch information
sourishkrout committed May 30, 2024
1 parent b8fd5cf commit 9fb95ea
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions internal/owl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,30 +501,34 @@ func (s *Store) Update(newOrUpdated, deleted []string) error {
s.mu.Lock()
defer s.mu.Unlock()

updateOpSet, err := NewOperationSet(WithOperation(UpdateSetOperation), WithSpecs(false))
if err != nil {
return err
}
if len(newOrUpdated) > 0 {
updateOpSet, err := NewOperationSet(WithOperation(UpdateSetOperation), WithSpecs(false))
if err != nil {
return err
}

err = updateOpSet.addEnvs("[execution]", newOrUpdated...)
if err != nil {
return err
err = updateOpSet.addEnvs("[execution]", newOrUpdated...)
if err != nil {
return err
}

s.opSets = append(s.opSets, updateOpSet)
}

s.opSets = append(s.opSets, updateOpSet)
if len(deleted) > 0 {
deleteOpSet, err := NewOperationSet(WithOperation(DeleteSetOperation), WithSpecs(false))
if err != nil {
return err
}

deleteOpSet, err := NewOperationSet(WithOperation(DeleteSetOperation), WithSpecs(false))
if err != nil {
return err
}
err = deleteOpSet.addEnvs("[execution]", deleted...)
if err != nil {
return err
}

err = deleteOpSet.addEnvs("[execution]", deleted...)
if err != nil {
return err
s.opSets = append(s.opSets, deleteOpSet)
}

s.opSets = append(s.opSets, deleteOpSet)

// s.logger.Debug("opSets size", zap.Int("size", len(s.opSets)))

return nil
Expand Down

0 comments on commit 9fb95ea

Please sign in to comment.