Skip to content

Commit cd6ff8d

Browse files
committed
feat: v1.9.1 — operator quality-of-life: tunable auto-blacklist, configurable batch timeout, MHRV_AUTH_KEY hint, run.bat CLI fallback
Four small fixes that address recurring user-issue patterns: - src/config.rs / src/domain_fronter.rs: auto_blacklist_strikes, auto_blacklist_window_secs, auto_blacklist_cooldown_secs config fields (#391, #444). Previously 3 strikes / 30s window / 120s cooldown were hard-coded. Single-deployment users on flaky networks hit this too aggressively; multi-deployment users want tighter fail-fast. Defaults preserve historical behavior. Power-user file edit only — no UI control yet. Clamps to [1, 86400] for durations. - src/config.rs / src/domain_fronter.rs / src/tunnel_client.rs: request_timeout_secs config field (#430, masterking32 PR #25). Replaces hard-coded BATCH_TIMEOUT 30s. DomainFronter::batch_timeout() exposes the value, fire_batch reads it. Clamped to [5s, 300s]. - tunnel-node/src/main.rs: detect MHRV_AUTH_KEY env var being set while TUNNEL_AUTH_KEY is unset, and emit a specific warning pointing at the right env var name. Catches the recurring #391/#444 docker run typo that made users chase phantom AUTH_KEY-mismatch decoys. - assets/launchers/run.bat: when both UI renderers (glow + wgpu) fail on older Windows / RDP / VM-without-GPU, fall back to launching mhrv-rs.exe (CLI) instead of just printing "open an issue". Addresses #417 / #426 / #487. CLI has the same proxy functionality on 127.0.0.1:8085 (HTTP) / :8086 (SOCKS5). 169 mhrv-rs lib tests + 33 tunnel-node tests still passing. UI build clean. ConfigWire round-trips the new fields with skip-default-on-write so unchanged configs stay clean.
1 parent 58fb141 commit cd6ff8d

9 files changed

Lines changed: 193 additions & 35 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mhrv-rs"
3-
version = "1.9.0"
3+
version = "1.9.1"
44
edition = "2021"
55
description = "Rust port of MasterHttpRelayVPN -- DPI bypass via Google Apps Script relay with domain fronting"
66
license = "MIT"

assets/launchers/run.bat

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,21 @@ if not "%UI_EXIT%"=="0" (
6060
echo - running inside RDP or a VM without GPU acceleration
6161
echo - antivirus blocking the exe — whitelist the folder and retry
6262
echo.
63-
echo Copy everything above and open an issue on:
64-
echo https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues
63+
echo You can still use mhrv-rs without the UI. Run the CLI directly:
64+
echo.
65+
echo mhrv-rs.exe
66+
echo.
67+
echo Set your config in %%APPDATA%%\mhrv-rs\config\config.json (or
68+
echo place a config.json next to mhrv-rs.exe in this folder), then
69+
echo point your browser proxy at 127.0.0.1:8085 (HTTP) or
70+
echo 127.0.0.1:8086 (SOCKS5). The CLI is the same proxy without
71+
echo the UI shell, so all functionality is available.
72+
echo.
73+
echo Falling back to the CLI now so you can keep using the proxy.
74+
echo Press Ctrl+C in the CLI window to stop it.
6575
echo ---------------------------------------------------
66-
pause
76+
echo.
77+
mhrv-rs.exe
6778
)
6879
)
6980

docs/changelog/v1.9.1.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- see docs/changelog/v1.1.0.md for the file format: Persian, then `---`, then English. -->
2+
• tunable کردن آستانه auto-blacklist با ۳ field config جدید: `auto_blacklist_strikes` (default 3)، `auto_blacklist_window_secs` (default 30)، `auto_blacklist_cooldown_secs` (default 120) ([#391](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/391)، [#444](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/444)): تا قبل، threshold روی ۳ timeout در ۳۰ ثانیه = ۱۲۰ ثانیه cooldown hard-coded بود. کاربران single-deployment گزارش دادن این threshold روی شبکه‌های flaky too aggressive هست — یک cold-start stall + دو network blip → فقط deployment آن‌ها lockout می‌شه. حالا قابل تنظیم: single-deployment users می‌تونن `auto_blacklist_strikes: 5` یا `auto_blacklist_cooldown_secs: 30` بزارن. کاربران multi-deployment با ۱۰+ alternatives می‌تونن `auto_blacklist_strikes: 2` بزارن برای fail-fast. defaults رفتار قدیمی رو حفظ می‌کنن — هیچ کاربری چیزی notice نمی‌کنه مگر در config صریح override کنه. کاربر در UI form expose نشده — power-user file edit در config.json. clamp [1, 86400] برای جلوگیری از مقادیر غیرمعقول.
3+
`request_timeout_secs` config (default 30) برای تنظیم batch HTTP timeout ([#430](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/430)، masterking32 PR #25): تا قبل `BATCH_TIMEOUT = 30s` hard-coded. شبکه‌های Iran ISP slow ممکنه `45` یا `60` بخوان تا Apps Script پیغام ارسال کنه past throttle window. شبکه‌های با fail-fast preference ممکنه `15` بخوان برای retry سریع‌تر هنگام hang. clamp [5s, 300s]. برای کاربر در UI form expose نشده.
4+
• warning روشن‌تر در tunnel-node startup برای recurring `MHRV_AUTH_KEY` typo ([#391](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/391)، [#444](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/444)): چندین قدیمی copy-paste guide از `MHRV_AUTH_KEY` به‌جای `TUNNEL_AUTH_KEY` در docker run استفاده می‌کرد. tunnel-node اون env var رو هرگز نمی‌خوند + silently default `changeme` رو fallback می‌کرد، که باعث AUTH_KEY-mismatch decoy می‌شد در client. حالا اگر `MHRV_AUTH_KEY` set باشه ولی `TUNNEL_AUTH_KEY` نباشه، tunnel-node پیغام specific می‌ده: "MHRV_AUTH_KEY is set but TUNNEL_AUTH_KEY is not — tunnel-node only reads TUNNEL_AUTH_KEY (uppercase, with underscores). Rename your env var: docker run ... -e TUNNEL_AUTH_KEY=...". این به کاربر مستقیم کمک می‌کنه به‌جای ساعت‌ها debug.
5+
• run.bat fallback به CLI بعد از UI failure ([#417](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/417)، [#426](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/426)، [#487](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/487)): قبلاً وقتی هر دو UI renderer (glow + wgpu) fail می‌گرفتن (روی ماشین‌های قدیمی Windows / RDP / VM بدون GPU)، script پیغام "open issue" می‌داد + exit. حالا بعد از پیغام error، CLI `mhrv-rs.exe` رو خود اجرا می‌کنه + کاربر می‌تونه به استفاده از proxy ادامه دهد. CLI همان full functionality رو داره بدون UI shell — proxy روی `127.0.0.1:8085` (HTTP) و `127.0.0.1:8086` (SOCKS5).
6+
---
7+
• Tunable auto-blacklist threshold via three new config fields: `auto_blacklist_strikes` (default 3), `auto_blacklist_window_secs` (default 30), `auto_blacklist_cooldown_secs` (default 120) ([#391](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/391), [#444](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/444)): previously hard-coded at "3 timeouts in 30s = 120s cooldown". Single-deployment users reported this threshold was too aggressive on flaky networks — one cold-start stall plus two transient network blips would lock them out of their only relay path. Now tunable: single-deployment users can set `auto_blacklist_strikes: 5` or `auto_blacklist_cooldown_secs: 30` to be more forgiving. Multi-deployment users with 10+ healthy alternatives can set `auto_blacklist_strikes: 2` to fail-fast. Defaults preserve existing behavior — no user notices a change unless they explicitly tune in `config.json`. Not exposed in the UI form yet — power-user file edit. Clamped to [1, 86400] for the duration fields to prevent absurd values.
8+
`request_timeout_secs` config field (default 30) to tune the batch HTTP timeout ([#430](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/430), masterking32 PR #25): previously the hard-coded `BATCH_TIMEOUT = 30s` constant. Slow Iran ISP networks may want `45` or `60` to give Apps Script time to respond past throttle windows. Networks preferring fail-fast may want `15` to retry sooner when a deployment hangs. Clamped to [5s, 300s] (anything beyond exceeds Apps Script's 6-min hard cap with no benefit). Not in the UI form.
9+
• Clearer tunnel-node startup warning for the recurring `MHRV_AUTH_KEY` typo ([#391](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/391), [#444](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/444)): several older copy-paste guides used `MHRV_AUTH_KEY` instead of `TUNNEL_AUTH_KEY` in `docker run`. tunnel-node never read that env var and silently fell back to default `changeme`, producing baffling AUTH_KEY-mismatch decoys on the client. Now if `MHRV_AUTH_KEY` is set but `TUNNEL_AUTH_KEY` is not, tunnel-node emits a specific warning: `"MHRV_AUTH_KEY is set but TUNNEL_AUTH_KEY is not — tunnel-node only reads TUNNEL_AUTH_KEY (uppercase, with underscores). Rename your env var: docker run ... -e TUNNEL_AUTH_KEY=<your-secret>"`. Saves users hours of debugging the wrong layer.
10+
`run.bat` falls back to CLI after UI renderer failure ([#417](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/417), [#426](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/426), [#487](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/487)): when both UI renderers (glow + wgpu) fail on older Windows machines, RDP sessions, or VMs without GPU acceleration, the script previously printed an "open an issue on GitHub" message and exited. Now it prints the diagnostic info AND launches `mhrv-rs.exe` (CLI) so the user can keep using the proxy without the UI shell. CLI has the same proxy functionality on `127.0.0.1:8085` (HTTP) and `127.0.0.1:8086` (SOCKS5); only the visual UI is missing.

src/bin/ui.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,14 @@ struct FormState {
272272
/// there is no UI editor for these yet, only file-edited config.
273273
/// See config.rs `fronting_groups`.
274274
fronting_groups: Vec<FrontingGroup>,
275+
/// Auto-blacklist tuning + per-batch timeout. Config-only knobs (no UI
276+
/// fields yet — power-user file edit). Round-tripped through FormState
277+
/// so Save preserves the user's hand-edited values. See config.rs
278+
/// `auto_blacklist_*` and `request_timeout_secs`.
279+
auto_blacklist_strikes: u32,
280+
auto_blacklist_window_secs: u64,
281+
auto_blacklist_cooldown_secs: u64,
282+
request_timeout_secs: u64,
275283
}
276284

277285
#[derive(Clone, Debug)]
@@ -369,6 +377,10 @@ fn load_form() -> (FormState, Option<String>) {
369377
tunnel_doh: c.tunnel_doh,
370378
bypass_doh_hosts: c.bypass_doh_hosts.clone(),
371379
fronting_groups: c.fronting_groups.clone(),
380+
auto_blacklist_strikes: c.auto_blacklist_strikes,
381+
auto_blacklist_window_secs: c.auto_blacklist_window_secs,
382+
auto_blacklist_cooldown_secs: c.auto_blacklist_cooldown_secs,
383+
request_timeout_secs: c.request_timeout_secs,
372384
}
373385
} else {
374386
FormState {
@@ -401,6 +413,12 @@ fn load_form() -> (FormState, Option<String>) {
401413
tunnel_doh: true,
402414
bypass_doh_hosts: Vec::new(),
403415
fronting_groups: Vec::new(),
416+
// Defaults match `default_auto_blacklist_*` and
417+
// `default_request_timeout_secs` in src/config.rs.
418+
auto_blacklist_strikes: 3,
419+
auto_blacklist_window_secs: 30,
420+
auto_blacklist_cooldown_secs: 120,
421+
request_timeout_secs: 30,
404422
}
405423
};
406424
(form, load_err)
@@ -567,6 +585,14 @@ impl FormState {
567585
// batch alongside the system-proxy toggle (#432).
568586
coalesce_step_ms: 0,
569587
coalesce_max_ms: 0,
588+
// Auto-blacklist + batch timeout: config-only knobs (#391,
589+
// #444, #430). Round-trip through FormState so Save doesn't
590+
// drop hand-edited values. UI editor planned alongside the
591+
// v1.8.x desktop UI batch.
592+
auto_blacklist_strikes: self.auto_blacklist_strikes,
593+
auto_blacklist_window_secs: self.auto_blacklist_window_secs,
594+
auto_blacklist_cooldown_secs: self.auto_blacklist_cooldown_secs,
595+
request_timeout_secs: self.request_timeout_secs,
570596
})
571597
}
572598
}
@@ -626,8 +652,25 @@ struct ConfigWire<'a> {
626652
bypass_doh_hosts: &'a Vec<String>,
627653
#[serde(skip_serializing_if = "Vec::is_empty")]
628654
fronting_groups: &'a Vec<FrontingGroup>,
655+
/// Auto-blacklist tuning + batch timeout (#391, #444, #430). Skip
656+
/// serialization when matching the historical defaults so unchanged
657+
/// configs stay clean — only emitted when the user has explicitly
658+
/// tuned them.
659+
#[serde(skip_serializing_if = "is_default_strikes")]
660+
auto_blacklist_strikes: u32,
661+
#[serde(skip_serializing_if = "is_default_window_secs")]
662+
auto_blacklist_window_secs: u64,
663+
#[serde(skip_serializing_if = "is_default_cooldown_secs")]
664+
auto_blacklist_cooldown_secs: u64,
665+
#[serde(skip_serializing_if = "is_default_timeout_secs")]
666+
request_timeout_secs: u64,
629667
}
630668

669+
fn is_default_strikes(v: &u32) -> bool { *v == 3 }
670+
fn is_default_window_secs(v: &u64) -> bool { *v == 30 }
671+
fn is_default_cooldown_secs(v: &u64) -> bool { *v == 120 }
672+
fn is_default_timeout_secs(v: &u64) -> bool { *v == 30 }
673+
631674
fn is_false(b: &bool) -> bool {
632675
!*b
633676
}
@@ -677,6 +720,10 @@ impl<'a> From<&'a Config> for ConfigWire<'a> {
677720
tunnel_doh: c.tunnel_doh,
678721
bypass_doh_hosts: &c.bypass_doh_hosts,
679722
fronting_groups: &c.fronting_groups,
723+
auto_blacklist_strikes: c.auto_blacklist_strikes,
724+
auto_blacklist_window_secs: c.auto_blacklist_window_secs,
725+
auto_blacklist_cooldown_secs: c.auto_blacklist_cooldown_secs,
726+
request_timeout_secs: c.request_timeout_secs,
680727
}
681728
}
682729
}

src/config.rs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,47 @@ pub struct Config {
291291
/// to the DoH bypass. Empty / missing = feature off.
292292
#[serde(default)]
293293
pub fronting_groups: Vec<FrontingGroup>,
294+
295+
/// Auto-blacklist tuning — how many timeouts within the window
296+
/// trip a per-deployment cooldown.
297+
///
298+
/// Default `3` matches the historical behavior. Single-deployment
299+
/// users who hit transient network blips have reported (#391, #444)
300+
/// that 3 strikes are too few — one cold-start stall plus two
301+
/// network glitches lock out their only relay path. Bumping to
302+
/// `5` or `6` is a reasonable workaround for that case.
303+
///
304+
/// Multi-deployment users with 10+ healthy alternatives can lower
305+
/// this (e.g. `2`) to fail-fast off a flaky deployment without
306+
/// burning latency on retries.
307+
#[serde(default = "default_auto_blacklist_strikes")]
308+
pub auto_blacklist_strikes: u32,
309+
310+
/// Window (seconds) for the auto-blacklist strike counter. Strikes
311+
/// older than this are dropped. Default `30`. Larger windows make
312+
/// the heuristic less twitchy at the cost of holding state longer
313+
/// for deployments that have already recovered.
314+
#[serde(default = "default_auto_blacklist_window_secs")]
315+
pub auto_blacklist_window_secs: u64,
316+
317+
/// Cooldown (seconds) when the strike threshold trips. Default
318+
/// `120`. Single-deployment users who can't afford a 2-min lockout
319+
/// when their only relay misbehaves can drop to `30` or `60`. Multi-
320+
/// deployment users with healthy alternatives can extend to `600`
321+
/// to keep a known-bad deployment out of rotation longer.
322+
#[serde(default = "default_auto_blacklist_cooldown_secs")]
323+
pub auto_blacklist_cooldown_secs: u64,
324+
325+
/// Per-batch HTTP round-trip timeout (seconds). Default `30` —
326+
/// matches Apps Script's typical response cliff and historical
327+
/// `BATCH_TIMEOUT` constant. Slow Iran ISP networks may want `45`
328+
/// or `60` to give Apps Script time to respond past throttle
329+
/// windows. Networks with fail-fast preference may want `15` to
330+
/// retry sooner when a deployment hangs. Floor `5`, ceiling `300`
331+
/// (anything beyond exceeds Apps Script's hard 6-min cap with
332+
/// no benefit).
333+
#[serde(default = "default_request_timeout_secs")]
334+
pub request_timeout_secs: u64,
294335
}
295336

296337
/// One multi-edge fronting group. Edge CDNs like Vercel and Fastly
@@ -342,6 +383,16 @@ fn default_google_ip_validation() -> bool {true}
342383
/// opt back in with `tunnel_doh: false`.
343384
fn default_tunnel_doh() -> bool { true }
344385

386+
/// Defaults for the auto-blacklist tuning knobs (#391, #444). These
387+
/// preserve historical behavior — `3 strikes / 30s window / 120s cooldown`.
388+
fn default_auto_blacklist_strikes() -> u32 { 3 }
389+
fn default_auto_blacklist_window_secs() -> u64 { 30 }
390+
fn default_auto_blacklist_cooldown_secs() -> u64 { 120 }
391+
392+
/// Default for `request_timeout_secs`: 30s, matching the historical
393+
/// hard-coded `BATCH_TIMEOUT` and Apps Script's typical response cliff.
394+
fn default_request_timeout_secs() -> u64 { 30 }
395+
345396
fn default_google_ip() -> String {
346397
"216.239.38.120".into()
347398
}

src/domain_fronter.rs

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,17 @@ pub struct DomainFronter {
140140
/// payloads. Mirrors `Config::disable_padding` (#391). Default false
141141
/// (padding active = stronger DPI defense at +25% bandwidth cost).
142142
disable_padding: bool,
143+
/// Per-instance auto-blacklist tuning. Mirrors `Config::auto_blacklist_*`
144+
/// (#391, #444). Cached here so the hot path in `record_timeout_strike`
145+
/// doesn't have to reach back through the Config (which we don't keep
146+
/// a reference to).
147+
auto_blacklist_strikes: u32,
148+
auto_blacklist_window: Duration,
149+
auto_blacklist_cooldown: Duration,
150+
/// Per-batch HTTP timeout. Mirrors `Config::request_timeout_secs`
151+
/// (#430, masterking32 PR #25). Read by `tunnel_client::fire_batch`
152+
/// so a single config field tunes the timeout used everywhere.
153+
batch_timeout: Duration,
143154
}
144155

145156
/// Aggregated stats for one remote host.
@@ -163,20 +174,11 @@ impl HostStat {
163174

164175
const BLACKLIST_COOLDOWN_SECS: u64 = 600;
165176

166-
/// Sliding window for the timeout-strike blacklist heuristic. Three
167-
/// timeouts within this window on a single deployment trip the
168-
/// blacklist. Tuned so a single cold-start stall plus one transient
169-
/// network blip won't false-trigger, but a deployment that's actually
170-
/// dead (stale `TUNNEL_SERVER_URL`, paused project, dropped script)
171-
/// fails fast instead of poisoning round-robin until the user notices.
172-
const TIMEOUT_STRIKE_WINDOW: Duration = Duration::from_secs(30);
173-
const TIMEOUT_STRIKE_LIMIT: u32 = 3;
174-
175-
/// Cooldown for a deployment blacklisted via the timeout-strike path.
176-
/// Distinct from `BLACKLIST_COOLDOWN_SECS` (10 min) because timeouts
177-
/// are a much noisier signal than quota errors — if the deployment
178-
/// recovers, we want to rejoin in minutes, not after a 10-min penalty.
179-
const TIMEOUT_BLACKLIST_COOLDOWN_SECS: u64 = 120;
177+
/// Auto-blacklist defaults are now per-instance fields on `DomainFronter`,
178+
/// driven by `Config::auto_blacklist_strikes` / `_window_secs` /
179+
/// `_cooldown_secs` (#391, #444). The constants below are gone — see the
180+
/// `Config` doc comments for tuning guidance and `default_auto_blacklist_*`
181+
/// for the historical defaults (3 strikes / 30s window / 120s cooldown).
180182
181183
/// Request payload sent to Apps Script (single, non-batch).
182184
#[derive(Serialize)]
@@ -299,9 +301,26 @@ impl DomainFronter {
299301
today_bytes: AtomicU64::new(0),
300302
today_key: std::sync::Mutex::new(current_pt_day_key()),
301303
disable_padding: config.disable_padding,
304+
auto_blacklist_strikes: config.auto_blacklist_strikes.max(1),
305+
auto_blacklist_window: Duration::from_secs(
306+
config.auto_blacklist_window_secs.clamp(1, 3600),
307+
),
308+
auto_blacklist_cooldown: Duration::from_secs(
309+
config.auto_blacklist_cooldown_secs.clamp(1, 86400),
310+
),
311+
batch_timeout: Duration::from_secs(
312+
config.request_timeout_secs.clamp(5, 300),
313+
),
302314
})
303315
}
304316

317+
/// Per-batch HTTP round-trip timeout. Read by `tunnel_client` so the
318+
/// `BATCH_TIMEOUT` constant doesn't have to be touched on every config
319+
/// change. Clamped to `[5s, 300s]` at construction.
320+
pub(crate) fn batch_timeout(&self) -> Duration {
321+
self.batch_timeout
322+
}
323+
305324
/// Record one relay call toward the daily budget. Called once per
306325
/// outbound Apps Script fetch. Rolls over both daily counters at
307326
/// 00:00 Pacific Time, matching Apps Script's quota reset cadence
@@ -483,22 +502,22 @@ impl DomainFronter {
483502
let entry = counts
484503
.entry(script_id.to_string())
485504
.or_insert((now, 0));
486-
if now.duration_since(entry.0) > TIMEOUT_STRIKE_WINDOW {
505+
if now.duration_since(entry.0) > self.auto_blacklist_window {
487506
*entry = (now, 1);
488507
} else {
489508
entry.1 += 1;
490509
}
491510
let strikes = entry.1;
492-
if strikes >= TIMEOUT_STRIKE_LIMIT {
511+
if strikes >= self.auto_blacklist_strikes {
493512
counts.remove(script_id);
494513
drop(counts);
495514
self.blacklist_script_for(
496515
script_id,
497-
Duration::from_secs(TIMEOUT_BLACKLIST_COOLDOWN_SECS),
516+
self.auto_blacklist_cooldown,
498517
&format!(
499518
"{} timeouts in {}s",
500519
strikes,
501-
TIMEOUT_STRIKE_WINDOW.as_secs()
520+
self.auto_blacklist_window.as_secs()
502521
),
503522
);
504523
}

0 commit comments

Comments
 (0)