@@ -71,9 +71,6 @@ class AlarmService extends BaseService {
71
71
* @returns {void }
72
72
*/
73
73
this . alarm_widget = ( ) => {
74
- // return `\x1B[31;1m alarms (${
75
- // Object.keys(this.alarms)
76
- // })\x1B[0m`;
77
74
const lines = [ ] ;
78
75
for ( const alarm of Object . values ( this . alarms ) ) {
79
76
const line =
@@ -97,12 +94,6 @@ class AlarmService extends BaseService {
97
94
}
98
95
99
96
adapt_id_ ( id ) {
100
- // let shorten = false;
101
- // // Check if id uses characters that aren't on a US QWERTY keyboard.
102
- // if ( /[^\x20-\x7E]/.test(id) ) shorten = true;
103
-
104
- // // Check if id is too long
105
- // if ( id.length > 20 ) shorten = true;
106
97
let shorten = true ;
107
98
108
99
if ( shorten ) {
@@ -344,7 +335,7 @@ class AlarmService extends BaseService {
344
335
// Write a .log file for the alert that happened
345
336
try {
346
337
const lines = [ ] ;
347
- lines . push ( `ALERT ${ alarm . id_string } :: ${ alarm . message } (${ alarm . count } )` ) ,
338
+ lines . push ( `ALERT ${ alarm . id_string } :: ${ alarm . message } (${ alarm . count } )` ) ;
348
339
lines . push ( `started: ${ new Date ( alarm . started ) . toISOString ( ) } ` ) ;
349
340
lines . push ( `short id: ${ alarm . short_id } ` ) ;
350
341
lines . push ( `original id: ${ alarm . id } ` ) ;
@@ -356,7 +347,7 @@ class AlarmService extends BaseService {
356
347
357
348
( async ( ) => {
358
349
try {
359
- await fs . appendFileSync ( `alert_${ alarm . id } .log` , alert_info + '\n' ) ;
350
+ fs . appendFileSync ( `alert_${ alarm . id } .log` , alert_info + '\n' ) ;
360
351
} catch ( e ) {
361
352
this . log . error ( `failed to write alert log: ${ e . message } ` ) ;
362
353
}
0 commit comments