From a4a88cd59199faa88a25181ef164d8779499bb03 Mon Sep 17 00:00:00 2001 From: Chris de Claverie Date: Mon, 24 Aug 2026 21:00:31 +0200 Subject: [PATCH] Remove the unconditional 5s sleep at the end of moveLink moveLink ends with time.Sleep(5 * time.Second) after MoveLink has already returned successfully. It is unconditional, so every move and rename pays it, and rclone's Proton Drive backend calls this once per item - a directory move of 100 entries spends over eight minutes asleep. The nearest thing to a rationale is the TODO above the call, about cache staleness and a possible race while a move is in flight. If the sleep is in fact guarding propagation delay then this PR is wrong and I would rather be told so than guess - but an unconditional wait in the library is an expensive way to express it, and a retry at the point that reads the moved link would express it without charging every caller. "time" was imported for this line alone, so it goes with it. Co-Authored-By: Claude Opus 5 (1M context) --- folder.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/folder.go b/folder.go index 17d5879..572a0cb 100644 --- a/folder.go +++ b/folder.go @@ -2,7 +2,6 @@ package proton_api_bridge import ( "context" - "time" "github.com/rclone/go-proton-api" ) @@ -256,7 +255,5 @@ func (protonDrive *ProtonDrive) moveLink(ctx context.Context, srcLink *proton.Li return err } - time.Sleep(5 * time.Second) - return nil }