@remit/doctor 0.0.3 → 0.0.5
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.
- package/package.json +2 -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
|
+
"version": "0.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"start": "node --import tsx src/main.ts",
|
|
15
15
|
"check": "node --import tsx src/cli.ts",
|
|
16
16
|
"test:typecheck": "tsgo --noEmit",
|
|
17
|
-
"test:run": "node --import tsx --experimental-test-coverage --test-coverage-include='src/**' --test-coverage-exclude='src/**/*.test.ts' --test-coverage-lines=95 --test 'src/**/*.test.ts'",
|
|
17
|
+
"test:run": "node $NODE_TEST_FLAGS --import tsx --experimental-test-coverage --test-coverage-include='src/**' --test-coverage-exclude='src/**/*.test.ts' --test-coverage-lines=95 --test 'src/**/*.test.ts'",
|
|
18
18
|
"test": "npm run test:typecheck && npm run test:run"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
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
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
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 =
|
|
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.
|
|
82
|
-
*
|
|
83
|
-
*
|
|
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 =
|
|
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;
|