Format repeated 429 message

This commit is contained in:
zzz
2025-06-08 16:08:42 -04:00
parent c7761895c0
commit 845b0531c0

View File

@@ -183,10 +183,12 @@ class RemoteSearch implements EepGet.StatusListener {
long now = _ctx.clock().now(); long now = _ctx.clock().now();
if (currentBan > now) { if (currentBan > now) {
long retry = currentBan - now; long retry = currentBan - now;
String msg;
if (retry <= 10*60*1000) if (retry <= 10*60*1000)
return _t("Rate limited for {0}", DataHelper.formatDuration(retry)); msg = _t("Rate limited for {0}", DataHelper.formatDuration(retry));
else else
return _t("Rate limited until {0}", DataHelper.formatTime(currentBan)); msg = _t("Rate limited until {0}", DataHelper.formatTime(currentBan));
return "<tr class=\"snarkTorrentNoneLoaded\"><td colspan=\"8\">" + msg;
} }
_bannedUntil.compareAndSet(currentBan, 0); _bannedUntil.compareAndSet(currentBan, 0);
} }