Skip to content

Commit

Permalink
fix lower syncing timeout and make it configurable
Browse files Browse the repository at this point in the history
Remove the hardcoded 5 minutes timeout and make it 2 by default which should be more than enough. THe user can change it setting the appropriate daemon flag


Former-commit-id: 458ef9f
  • Loading branch information
juligasa committed Sep 15, 2022
1 parent b5e043a commit df9aea1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func Default() Config {
Syncing: Syncing{
WarmupDuration: time.Minute,
Interval: time.Minute,
TimeoutPerPeer: time.Minute * 5,
TimeoutPerPeer: time.Minute * 2,
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion backend/syncing/syncing.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func (s *Service) Sync(ctx context.Context) (res SyncResult, err error) {
go func(i int, dev vcssql.DevicesListResult) {
defer wg.Done()

ctx, cancel := context.WithTimeout(ctx, time.Minute*5)
ctx, cancel := context.WithTimeout(ctx, s.peerSyncTimeout)
defer cancel()

did := cid.NewCidV1(core.CodecDeviceKey, dev.DevicesMultihash)
Expand Down

0 comments on commit df9aea1

Please sign in to comment.