Skip to content

Commit

Permalink
f3: Correctly renew leases early
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Oct 25, 2024
1 parent 7d91248 commit f5ff54c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ require (
github.com/ipfs/go-ipld-cbor v0.2.0
github.com/ipfs/go-log/v2 v2.5.1
github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438
github.com/jpillora/backoff v1.0.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/libp2p/go-buffer-pool v0.1.0
github.com/manifoldco/promptui v0.9.0
Expand Down Expand Up @@ -206,6 +205,7 @@ require (
github.com/jessevdk/go-flags v1.4.0 // indirect
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/kilic/bls12-381 v0.1.1-0.20220929213557-ca162e8a70f4 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
Expand Down
2 changes: 2 additions & 0 deletions tasks/f3/f3_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ func (f *F3Task) participateLoop(ctx context.Context, stillOwned func() bool, ti
case err != nil:
log.Errorw("Unexpected error while attempting F3 participation. Retrying after backoff", "err", err)
return xerrors.Errorf("attempting F3 participation with ticket: %w", err)
case lease.ValidityTerm <= renewLeaseWithin:
return nil // Return to get a new ticket
default:
// Successfully participated
if !haveLease {
Expand Down

0 comments on commit f5ff54c

Please sign in to comment.