Skip to content

Commit

Permalink
REF: logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Overtorment committed Jul 10, 2024
1 parent e307f65 commit aab883a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "groundcontrol",
"version": "2.3.0",
"version": "2.3.1",
"description": "GroundControl push server API",
"devDependencies": {
"@types/node": "18.7.16",
Expand Down
2 changes: 1 addition & 1 deletion src/worker-blockprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function processBlock(blockNum, sendQueueRepository: Repository<SendQueue>
}
}

console.warn(addresses.length, "addresses paid in block");
console.log(addresses.length, "addresses paid in block");
// allPotentialPushPayloadsArray.push({ address: "bc1qaemfnglf928kd9ma2jzdypk333au6ctu7h7led", txid: "666", sat: 1488, type: 2, token: "", os: "ios" }); // debug fixme
// addresses.push("bc1qaemfnglf928kd9ma2jzdypk333au6ctu7h7led"); // debug fixme

Expand Down
2 changes: 1 addition & 1 deletion src/worker-processmempool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ dataSource
try {
await processMempool();
} catch (error) {
console.log(error);
console.warn('Exception in processMempool():', error);
}
const end = +new Date();
process.env.VERBOSE && console.log("processing mempool took", (end - start) / 1000, "sec");
Expand Down
10 changes: 5 additions & 5 deletions src/worker-sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,31 +91,31 @@ dataSource
switch (payload.type) {
case 2:
payload = <components["schemas"]["PushNotificationOnchainAddressGotPaid"]>payload;
process.env.VERBOSE && console.warn("pushing to token", payload.token, payload.os);
process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os);
await GroundControlToMajorTom.pushOnchainAddressWasPaid(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload);
await sendQueueRepository.remove(record);
break;
case 3:
payload = <components["schemas"]["PushNotificationOnchainAddressGotUnconfirmedTransaction"]>payload;
process.env.VERBOSE && console.warn("pushing to token", payload.token, payload.os);
process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os);
await GroundControlToMajorTom.pushOnchainAddressGotUnconfirmedTransaction(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload);
await sendQueueRepository.remove(record);
break;
case 1:
payload = <components["schemas"]["PushNotificationLightningInvoicePaid"]>payload;
process.env.VERBOSE && console.warn("pushing to token", payload.token, payload.os);
process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os);
await GroundControlToMajorTom.pushLightningInvoicePaid(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload);
await sendQueueRepository.remove(record);
break;
case 4:
payload = <components["schemas"]["PushNotificationTxidGotConfirmed"]>payload;
process.env.VERBOSE && console.warn("pushing to token", payload.token, payload.os);
process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os);
await GroundControlToMajorTom.pushOnchainTxidGotConfirmed(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload);
await sendQueueRepository.remove(record);
break;
case 5:
payload = <components["schemas"]["PushNotificationMessage"]>payload;
process.env.VERBOSE && console.warn("pushing to token", payload.token, payload.os);
process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os);
await GroundControlToMajorTom.pushMessage(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload);
await sendQueueRepository.remove(record);
break;
Expand Down

0 comments on commit aab883a

Please sign in to comment.