Skip to content

Commit

Permalink
[WIP] feat(ds-replayer): build a ds replayer for replaying txs
Browse files Browse the repository at this point in the history
  • Loading branch information
elliothllm committed Feb 27, 2025
1 parent a278402 commit 8d8f07c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions zk/replayer/replayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,20 @@ func (r *Replayer) Run(ctx context.Context) error {
var progress uint64

go func() {
if err := dsClient.ReadAllEntriesToChannel(); err != nil {
log.Error("Failed to read all entries to channel", "error", err)
return
for {
func() {
defer func() {
if r := recover(); r != nil {
log.Error("Recovered from panic in ReadAllEntriesToChannel", "panic", r)
}
}()

if err := dsClient.ReadAllEntriesToChannel(); err != nil {
log.Error("Failed to read all entries to channel, retrying...", "error", err)
time.Sleep(1 * time.Second)
return
}
}()
}
}()

Expand Down

0 comments on commit 8d8f07c

Please # to comment.