Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prune Unnecessary Logs #465

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions runner/src/dml-handler/dml-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ export default class DmlHandler {
const query = `INSERT INTO ${schemaName}."${tableName}" (${keys.join(', ')}) VALUES %L RETURNING *`;

const result = await wrapError(async () => await this.pgClient.query(this.pgClient.format(query, values), []), `Failed to execute '${query}' on ${schemaName}."${tableName}".`);
if (result.rows?.length === 0) {
console.log('No rows were inserted.');
}
return result.rows;
}

Expand All @@ -53,9 +50,6 @@ export default class DmlHandler {
}

const result = await wrapError(async () => await this.pgClient.query(this.pgClient.format(query), values), `Failed to execute '${query}' on ${schemaName}."${tableName}".`);
if (!(result.rows && result.rows.length > 0)) {
console.log('No rows were selected.');
}
return result.rows;
}

Expand All @@ -69,9 +63,6 @@ export default class DmlHandler {
const query = `UPDATE ${schemaName}."${tableName}" SET ${updateParam} WHERE ${whereParam} RETURNING *`;

const result = await wrapError(async () => await this.pgClient.query(this.pgClient.format(query), queryValues), `Failed to execute '${query}' on ${schemaName}."${tableName}".`);
if (!(result.rows && result.rows.length > 0)) {
console.log('No rows were selected.');
}
return result.rows;
}

Expand All @@ -87,9 +78,6 @@ export default class DmlHandler {
const query = `INSERT INTO ${schemaName}."${tableName}" (${keys.join(', ')}) VALUES %L ON CONFLICT (${conflictColumns.join(', ')}) DO UPDATE SET ${updatePlaceholders} RETURNING *`;

const result = await wrapError(async () => await this.pgClient.query(this.pgClient.format(query, values), []), `Failed to execute '${query}' on ${schemaName}."${tableName}".`);
if (result.rows?.length === 0) {
console.log('No rows were inserted or updated.');
}
return result.rows;
}

Expand All @@ -100,9 +88,6 @@ export default class DmlHandler {
const query = `DELETE FROM ${schemaName}."${tableName}" WHERE ${param} RETURNING *`;

const result = await wrapError(async () => await this.pgClient.query(this.pgClient.format(query), values), `Failed to execute '${query}' on ${schemaName}."${tableName}".`);
if (!(result.rows && result.rows.length > 0)) {
console.log('No rows were deleted.');
}
return result.rows;
}
}
3 changes: 1 addition & 2 deletions runner/src/indexer/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class Indexer {
const indexerFunction = functions[functionName];

const runningMessage = `Running function ${functionName} on block ${blockHeight}` + (isHistorical ? ' historical backfill' : `, lag is: ${lag?.toString()}ms from block timestamp`);
console.log(runningMessage); // Print the running message to the console (Lambda logs)
console.log(runningMessage); // Print the running message to the console

simultaneousPromises.push(this.writeLog(functionName, blockHeight, runningMessage));

Expand Down Expand Up @@ -192,7 +192,6 @@ export default class Indexer {
}

const tableNamesArray = Array.from(tableNames);
console.log('Retrieved the following table names from schema: ', tableNamesArray);
return Array.from(tableNamesArray);
}

Expand Down
1 change: 0 additions & 1 deletion runner/src/stream-handler/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ async function blockQueueProducer (workerContext: WorkerContext, streamKey: stri
streamMessageStartId = '0';
continue;
}
console.log(`Fetched ${messages?.length} messages from stream ${streamKey}`);

for (const streamMessage of messages) {
const { id, message } = streamMessage;
Expand Down