mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-03 11:22:25 +00:00
Refactor numeric constants to centralized module
- Introduce `js/constants.js` with semantic time constants (e.g., `ONE_MINUTE_MS`, `STANDARD_TIMEOUT_MS`) and feature-specific TTLs. - Export `KIND_MUTE_LIST` from `js/nostrEventSchemas.js` to standardize NIP-51 mute list kind usage. - Refactor `js/state/cache.js`, `js/nostr/cachePolicies.js`, `js/channelProfile.js`, and various services to use centralized constants instead of hardcoded magic numbers. - Update `js/nostr/relayConstants.js` to derive values from the shared time constants. - Replace duplicate definitions of timeouts and retry delays across the codebase. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
83d8023767
commit
c47392aba6
17 files changed
+92
-47
No files matched your search
@@ -1,7 +1,8 @@
|
||||
import { devLogger } from "../utils/logger.js";
|
||||
import { FIVE_MINUTES_MS, ONE_MINUTE_MS } from "../constants.js";
|
||||
|
||||
const DEFAULT_IDF_REFRESH_INTERVAL_MS = 5 * 60 * 1000;
|
||||
const DEFAULT_HISTORY_REFRESH_INTERVAL_MS = 60 * 1000;
|
||||
const DEFAULT_IDF_REFRESH_INTERVAL_MS = FIVE_MINUTES_MS;
|
||||
const DEFAULT_HISTORY_REFRESH_INTERVAL_MS = ONE_MINUTE_MS;
|
||||
const DEFAULT_REFRESH_DEBOUNCE_MS = 200;
|
||||
|
||||
let workerInstance = null;
|
||||
|
||||
Reference in new issue
Block a user