Skip to content

Commit

Permalink
SNRGY-3284 remove StrictWaitBeforeDone
Browse files Browse the repository at this point in the history
  • Loading branch information
IngoRoessner committed May 27, 2024
1 parent a242a5a commit 3f166a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
10 changes: 6 additions & 4 deletions lib/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ type UserCommandMsg struct {
}

type CommandWrapper struct {
Command string `json:"command"`
Id string `json:"id"`
Owner string `json:"owner"`
StrictWaitBeforeDone bool `json:"strict_wait_before_done"`
Command string `json:"command"`
Id string `json:"id"`
Owner string `json:"owner"`

//field has been removed but can still exist as value in kafka
//StrictWaitBeforeDone bool `json:"strict_wait_before_done"`
}

//RIGHTS commands are expected to be produced in the same partition as PUT and DELETE commands for the same resource/id
Expand Down
12 changes: 0 additions & 12 deletions lib/worker/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,6 @@ func (this *Worker) UpdateFeatures(kind string, msg []byte, command model.Comman
client.Index.WithIfSeqNo(int(version.SeqNo)),
client.Index.WithContext(ctx),
}
if command.StrictWaitBeforeDone {
options = append(options, client.Index.WithRefresh("wait_for"))
}
resp, err := client.Index(
kind,
opensearchutil.NewJSONReader(entry),
Expand All @@ -245,9 +242,6 @@ func (this *Worker) UpdateFeatures(kind string, msg []byte, command model.Comman
client.Index.WithDocumentID(command.Id),
client.Index.WithContext(ctx),
}
if command.StrictWaitBeforeDone {
options = append(options, client.Index.WithRefresh("wait_for"))
}
resp, err := client.Index(
kind,
opensearchutil.NewJSONReader(entry),
Expand Down Expand Up @@ -312,9 +306,6 @@ func (this *Worker) UpdateRights(kind string, msg []byte, command model.CommandW
client.Index.WithIfSeqNo(int(version.SeqNo)),
client.Index.WithContext(ctx),
}
if command.StrictWaitBeforeDone {
options = append(options, client.Index.WithRefresh("wait_for"))
}
resp, err := client.Index(
kind,
opensearchutil.NewJSONReader(entry),
Expand All @@ -341,9 +332,6 @@ func (this *Worker) DeleteFeatures(kind string, command model.CommandWrapper) (e
if exists {
client := this.query.GetClient()
options := []func(*opensearchapi.DeleteRequest){client.Delete.WithContext(ctx)}
if command.StrictWaitBeforeDone {
options = append(options, client.Delete.WithRefresh("wait_for"))
}
resp, err := client.Delete(
kind,
command.Id,
Expand Down

0 comments on commit 3f166a3

Please sign in to comment.