From f3c5cd9df287e1dc999af138cdf3ea8807be8eae Mon Sep 17 00:00:00 2001 From: JT Olio Date: Sat, 25 Jun 2022 21:58:30 -0400 Subject: [PATCH] cmd/satellite: limit time spent restoring trash from a node okay to do now that https://review.dev.storj.io/c/storj/storj/+/7882 is widely deployed Change-Id: I26c9a982b3999186e7c34a30515d151bf18a8648 --- cmd/satellite/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/satellite/main.go b/cmd/satellite/main.go index a0bbeabdf..b8d52ad27 100644 --- a/cmd/satellite/main.go +++ b/cmd/satellite/main.go @@ -882,6 +882,9 @@ func cmdRestoreTrash(cmd *cobra.Command, args []string) error { undelete := func(node *overlay.SelectedNode) { log.Info("starting restore trash", zap.String("Node ID", node.ID.String())) + ctx, cancel := context.WithTimeout(ctx, 10*time.Second) + defer cancel() + conn, err := dialer.DialNodeURL(ctx, storj.NodeURL{ ID: node.ID, Address: node.Address.Address,