Skip to content

Commit

Permalink
Actor Reminder: Retry Scheduler CreateRemidner (dapr#8057)
Browse files Browse the repository at this point in the history
Add a retry to the actor CreateReminder call to the scheduler.

Signed-off-by: joshvanl <[email protected]>
  • Loading branch information
JoshVanL authored Sep 5, 2024
1 parent 95284a3 commit dd50e7e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/actors/reminders/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import (
"context"
"encoding/json"
"fmt"
"time"

retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/wrapperspb"
Expand Down Expand Up @@ -122,7 +124,10 @@ func (s *scheduler) CreateReminder(ctx context.Context, reminder *internal.Creat
},
}

_, err = s.clients.Next().ScheduleJob(ctx, internalScheduleJobReq)
_, err = s.clients.Next().ScheduleJob(ctx, internalScheduleJobReq,
retry.WithMax(3),
retry.WithPerRetryTimeout(time.Second/2),
)
if err != nil {
log.Errorf("Error scheduling reminder job %s due to: %s", reminder.Name, err)
}
Expand Down

0 comments on commit dd50e7e

Please sign in to comment.