mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-11-08 05:42:12 +00:00
[constants] Refactor 1000 to MS_PER_SECOND
- Extracted MS_PER_SECOND to src/constants.mjs - Replaced literal 1000 in src/relay-health.mjs, src/utils.mjs, src/lib.mjs, src/lock-ops.mjs - Updated test/scheduler-lock-failure-schema.contract.test.mjs to copy constants.mjs - Added task log and artifacts Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
510e05ab54
commit
2174e8bc4d
11 files changed
+54
-9
No files matched your search
+3
-2
@@ -14,6 +14,7 @@ import {
|
||||
DEFAULT_QUARANTINE_COOLDOWN_MS,
|
||||
DEFAULT_MAX_QUARANTINE_COOLDOWN_MS,
|
||||
DEFAULT_SNAPSHOT_INTERVAL_MS,
|
||||
MS_PER_SECOND,
|
||||
} from './constants.mjs';
|
||||
import { nowUnix } from './utils.mjs';
|
||||
|
||||
@@ -43,9 +44,9 @@ export function parseLockEvent(event) {
|
||||
eventId: event.id,
|
||||
pubkey: event.pubkey,
|
||||
createdAt: event.created_at,
|
||||
createdAtIso: new Date(event.created_at * 1000).toISOString(),
|
||||
createdAtIso: new Date(event.created_at * MS_PER_SECOND).toISOString(),
|
||||
expiresAt,
|
||||
expiresAtIso: expiresAt ? new Date(expiresAt * 1000).toISOString() : null,
|
||||
expiresAtIso: expiresAt ? new Date(expiresAt * MS_PER_SECOND).toISOString() : null,
|
||||
dTag,
|
||||
agent: content.agent ?? null,
|
||||
cadence: content.cadence ?? null,
|
||||
|
||||
Reference in new issue
Block a user