aboutsummaryrefslogtreecommitdiff
path: root/internal/node/secondary/secondary.go
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2022-07-19 12:25:13 +0200
committerLinus Nordberg <linus@nordberg.se>2022-07-19 12:42:36 +0200
commitc8180107a6c281320fff2675abd7943cf5acafe2 (patch)
tree455edd11c90b383fb2ec7bec4d1f3a12dbc8edb5 /internal/node/secondary/secondary.go
parent7d957cabe69ecc2e59031e3d0a1b8120d5823670 (diff)
don't limit time for fetching leaves from primary to 10s
We might want to limit _each_request_ to something, but we'll leave that for now.
Diffstat (limited to 'internal/node/secondary/secondary.go')
-rw-r--r--internal/node/secondary/secondary.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/internal/node/secondary/secondary.go b/internal/node/secondary/secondary.go
index c181420..d2d3d43 100644
--- a/internal/node/secondary/secondary.go
+++ b/internal/node/secondary/secondary.go
@@ -68,17 +68,14 @@ func (s Secondary) InternalHTTPHandlers() []handler.Handler {
}
func (s Secondary) fetchLeavesFromPrimary(ctx context.Context) {
- sctx, cancel := context.WithTimeout(ctx, time.Second*10) // FIXME: parameterize 10
- defer cancel()
-
- prim, err := s.Primary.GetUnsignedTreeHead(sctx)
+ prim, err := s.Primary.GetUnsignedTreeHead(ctx)
if err != nil {
log.Warning("unable to get tree head from primary: %v", err)
return
}
log.Debug("got tree head from primary, size %d", prim.TreeSize)
- curTH, err := treeHeadFromTrillian(sctx, s.TrillianClient)
+ curTH, err := treeHeadFromTrillian(ctx, s.TrillianClient)
if err != nil {
log.Warning("unable to get tree head from trillian: %v", err)
return
@@ -89,7 +86,8 @@ func (s Secondary) fetchLeavesFromPrimary(ctx context.Context) {
StartSize: uint64(index),
EndSize: prim.TreeSize - 1,
}
- leaves, err = s.Primary.GetLeaves(sctx, req)
+ // TODO: set context per request
+ leaves, err = s.Primary.GetLeaves(ctx, req)
if err != nil {
log.Warning("error fetching leaves [%d..%d] from primary: %v", req.StartSize, req.EndSize, err)
return