@remit/doctor 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/config.ts +19 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/doctor",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
package/src/config.ts CHANGED
@@ -68,26 +68,35 @@ const DEFAULT_HEARTBEAT_SERVICES = [
68
68
  const DEFAULT_HEARTBEAT_MAX_AGE_SECONDS = 420;
69
69
 
70
70
  /**
71
- * Three hours. `remit_account_sync_age_seconds` sawtooths: the scheduler ticks
72
- * hourly by default (`MAILBOX_SYNC_TICK_INTERVAL_SECONDS`) and a tick skips a
73
- * mailbox stamped inside the freshness window, so a perfectly healthy account
74
- * climbs past an hour every cycle. A threshold at or near the tick fires on
75
- * accounts that are fine; raise this if you raised the tick.
71
+ * One hour. `remit_account_sync_age_seconds` sawtooths, and the height of the
72
+ * tooth is the scheduler's OFFLINE interval the age at which an account
73
+ * becomes due plus one TICK of sampling lag before a tick picks it up, plus
74
+ * the round itself. At the standalone stack's 15-minute offline interval and
75
+ * 5-minute tick (deploy/vps/docker-compose.sqlite.yml) a healthy account peaks
76
+ * around 25 minutes, so an hour clears it with room for several consecutive
77
+ * failed rounds and still names a genuinely stalled account inside the hour.
78
+ *
79
+ * A threshold below that peak fires on accounts that are fine, which is the
80
+ * failure that matters most here: this is the signal that says mail stopped
81
+ * arriving, and a signal that cries wolf is one an operator learns to ignore.
82
+ * Raise this if you raised either scheduler interval.
76
83
  */
77
- const DEFAULT_SYNC_AGE_MAX_SECONDS = 3 * 60 * 60;
84
+ const DEFAULT_SYNC_AGE_MAX_SECONDS = 60 * 60;
78
85
 
79
86
  /**
80
87
  * How long after the last authentication failure the condition still counts as
81
- * failing. Three hours, for the same reason the sync-age threshold is three
82
- * hours: authentication is retried on the sync tick, so the failures arrive in
83
- * one burst per tick and the gaps between bursts are not recoveries.
88
+ * failing. One hour, held equal to the sync-age threshold: authentication is
89
+ * retried on the sync cycle, so the failures arrive in one burst per cycle and
90
+ * the gaps between bursts are not recoveries, and two windows of the same width
91
+ * mean a deployment that fixes its password gets one recovery message rather
92
+ * than two.
84
93
  *
85
94
  * The signal is a counter delta, which is true for exactly one check. Without a
86
95
  * hold the reason appears on one check in sixty and the three-check dwell never
87
96
  * settles, so the one class of failure that never resolves itself would be the
88
97
  * one that never alerts.
89
98
  */
90
- const DEFAULT_AUTH_FAILURE_HOLD_SECONDS = 3 * 60 * 60;
99
+ const DEFAULT_AUTH_FAILURE_HOLD_SECONDS = 60 * 60;
91
100
 
92
101
  /** D8's number. Configurable so an operator can trade latency for quiet. */
93
102
  const DEFAULT_DWELL_CHECKS = 3;