Skip to content

Commit

Permalink
Fix to check error of watch response
Browse files Browse the repository at this point in the history
Signed-off-by: morimoto-cybozu <[email protected]>
  • Loading branch information
morimoto-cybozu committed Jul 26, 2023
1 parent a37e5a9 commit 67b75a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ func (a *Agent) StartWatching(ctx context.Context, updateCh chan<- struct{}) err
clientv3.WithProgressNotify(),
)
for wresp := range rch {
if err := wresp.Err(); err != nil {
return err
}

atomic.StoreInt64(&a.rev, wresp.Header.Revision)

// notify updater if possible
Expand Down

0 comments on commit 67b75a9

Please sign in to comment.