Skip to content

Commit 5f38f4d

Browse files
authored
Merge pull request #173 from Theodo-UK/fix/revert-notifier-code-removal
Revert code removal
2 parents be831a9 + c2c4cdb commit 5f38f4d

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

src/index.js

+25-11
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class Main {
210210
// Round to closest interval to make query faster.
211211
this.startTime = new Date(
212212
Math.round(new Date().getTime() / this.interval) * this.interval -
213-
dateOffset
213+
dateOffset
214214
);
215215
}
216216

@@ -233,6 +233,15 @@ class Main {
233233
this.previousSubmittedEvent = {};
234234
// Dictionary to store previous submissions for each lambda function
235235
this.previousLambdaPayload = {};
236+
237+
// Store previous errorId found in logs
238+
this.prevErrorId = "";
239+
// Flag to avoid getting notifications on first retrieval of logs
240+
this.firstLogsRetrieved = false;
241+
// Store events from cloudwatchLogs
242+
this.events = [];
243+
// Allows use of .bell() function for notifications
244+
this.notifier = new blessed.Program();
236245
}
237246

238247
setKeypresses() {
@@ -339,17 +348,22 @@ class Main {
339348

340349
async updateGraphs() {
341350
if (this.resourceTable.fullFuncName) {
342-
this.data = await getLambdaMetrics(this, this.resourceTable.fullFuncName, cloudwatch);
343-
getLogEvents(`/aws/lambda/${this.resourceTable.fullFuncName}`, cloudwatchLogs).then(
344-
(data) => {
345-
this.events = data;
346-
updateLogContentsFromEvents(this.lambdaLog, this.events);
347-
checkLogsForErrors(this.events, this);
348-
this.setFirstLogsRetrieved(true);
349-
350-
this.durationBarChart.updateData();
351-
}
351+
this.data = await getLambdaMetrics(
352+
this,
353+
this.resourceTable.fullFuncName,
354+
cloudwatch
352355
);
356+
getLogEvents(
357+
`/aws/lambda/${this.resourceTable.fullFuncName}`,
358+
cloudwatchLogs
359+
).then((data) => {
360+
this.events = data;
361+
updateLogContentsFromEvents(this.lambdaLog, this.events);
362+
checkLogsForErrors(this.events, this);
363+
this.setFirstLogsRetrieved(true);
364+
365+
this.durationBarChart.updateData();
366+
});
353367
}
354368

355369
this.padInvocationsAndErrorsWithZeros();

0 commit comments

Comments
 (0)