Skip to content

Commit

Permalink
refactor: make magic number a const
Browse files Browse the repository at this point in the history
  • Loading branch information
ozyx committed Sep 30, 2024
1 parent 35f3e60 commit 408325d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion example/faultManagement/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*****************************************************************************/

const SEVERITIES = ['WATCH', 'WARNING', 'CRITICAL'];
const MOONWALK_TIMESTAMP = 14159040000;
const NAMESPACE = '/Example/fault-';
const getRandom = {
severity: () => SEVERITIES[Math.floor(Math.random() * 3)],
Expand All @@ -36,7 +37,7 @@ const getRandom = {
val = num;
severity = SEVERITIES[severityIndex - 1];
// Subtract `num` from the timestamp so that the faults are in order
time = 14159040000 - num; // Mon, 21 Jul 1969 02:56:00 GMT πŸŒ”πŸ‘¨β€πŸš€πŸ‘¨β€πŸš€πŸ‘¨β€πŸš€
time = MOONWALK_TIMESTAMP - num; // Mon, 21 Jul 1969 02:56:00 GMT πŸŒ”πŸ‘¨β€πŸš€πŸ‘¨β€πŸš€πŸ‘¨β€πŸš€
}

return {
Expand Down

0 comments on commit 408325d

Please sign in to comment.