Logging cleanup

pull/310/head
Frostebite 2021-09-21 20:22:29 +01:00
parent b771df9510
commit e9beedfcf1
3 changed files with 7 additions and 7 deletions

6
dist/index.js vendored
View File

@ -815,14 +815,14 @@ class AWSBuildRunner {
static checkStreamingShouldContinue(taskData, timestamp, readingLogs) { static checkStreamingShouldContinue(taskData, timestamp, readingLogs) {
if ((taskData === null || taskData === void 0 ? void 0 : taskData.lastStatus) !== 'RUNNING') { if ((taskData === null || taskData === void 0 ? void 0 : taskData.lastStatus) !== 'RUNNING') {
if (timestamp === 0) { if (timestamp === 0) {
cloud_runner_logger_1.default.log('Cloud runner job stopped, streaming end of logs'); cloud_runner_logger_1.default.log('## Cloud runner job stopped, streaming end of logs');
timestamp = Date.now(); timestamp = Date.now();
} }
if (timestamp !== 0 && Date.now() - timestamp < 30000) { if (timestamp !== 0 && Date.now() - timestamp < 30000) {
cloud_runner_logger_1.default.log('Cloud runner status is not RUNNING for 30 seconds, last query for logs'); cloud_runner_logger_1.default.log('## Cloud runner status is not RUNNING for 30 seconds, last query for logs');
readingLogs = false; readingLogs = false;
} }
cloud_runner_logger_1.default.log(`Status of job: ${taskData.lastStatus}`); cloud_runner_logger_1.default.log(`## Status of job: ${taskData.lastStatus}`);
} }
return { timestamp, readingLogs }; return { timestamp, readingLogs };
} }

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -148,14 +148,14 @@ class AWSBuildRunner {
private static checkStreamingShouldContinue(taskData: AWS.ECS.Task, timestamp: number, readingLogs: boolean) { private static checkStreamingShouldContinue(taskData: AWS.ECS.Task, timestamp: number, readingLogs: boolean) {
if (taskData?.lastStatus !== 'RUNNING') { if (taskData?.lastStatus !== 'RUNNING') {
if (timestamp === 0) { if (timestamp === 0) {
CloudRunnerLogger.log('Cloud runner job stopped, streaming end of logs'); CloudRunnerLogger.log('## Cloud runner job stopped, streaming end of logs');
timestamp = Date.now(); timestamp = Date.now();
} }
if (timestamp !== 0 && Date.now() - timestamp < 30000) { if (timestamp !== 0 && Date.now() - timestamp < 30000) {
CloudRunnerLogger.log('Cloud runner status is not RUNNING for 30 seconds, last query for logs'); CloudRunnerLogger.log('## Cloud runner status is not RUNNING for 30 seconds, last query for logs');
readingLogs = false; readingLogs = false;
} }
CloudRunnerLogger.log(`Status of job: ${taskData.lastStatus}`); CloudRunnerLogger.log(`## Status of job: ${taskData.lastStatus}`);
} }
return { timestamp, readingLogs }; return { timestamp, readingLogs };
} }