Skip to content

Commit

Permalink
Do not update on rent collection (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass authored Nov 10, 2023
1 parent efbe053 commit d102547
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/account-postgres-sink-service/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
npm-debug.log
dist/
tmp/
./node_modules
./node_modules
.env
3 changes: 2 additions & 1 deletion packages/account-postgres-sink-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"precommit": "npx git-format-staged -f 'prettier --ignore-unknown --stdin --stdin-filepath \"{}\"' .",
"build": "tsc -p tsconfig.json",
"start": "node lib/esm/server.js",
"dev": "npx ts-node --project tsconfig.cjs.json src/server.ts"
"dev": "ts-node-dev --respawn --project tsconfig.cjs.json src/server.ts"
},
"dependencies": {
"@coral-xyz/anchor": "^0.28.0",
Expand All @@ -43,6 +43,7 @@
"bn.js": "^5.2.0",
"bs58": "^4.0.1",
"deep-equal": "^2.2.2",
"dotenv": "^16.3.1",
"fastify": "^4.13.0",
"fastify-cron": "^1.3.1",
"fastify-metrics": "^10.3.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/account-postgres-sink-service/src/env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import os from 'os';
import dotenv from "dotenv";

dotenv.config();


process.env.ANCHOR_WALLET =
process.env.ANCHOR_WALLET || os.homedir() + '/.config/solana/id.json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function handleAccountWebhook({
const value = await model.findByPk(account.pubkey);
const changed =
!value ||
Object.entries(sanitized).some(([k, v]) => v !== value.dataValues[k]);
Object.entries(sanitized).some(([k, v]) => v?.toString() !== value.dataValues[k]?.toString());
if (changed) {
await model.upsert(
{
Expand Down
8 changes: 8 additions & 0 deletions packages/account-postgres-sink-service/yarn.deploy.lock
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ __metadata:
bn.js: ^5.2.0
bs58: ^4.0.1
deep-equal: ^2.2.2
dotenv: ^16.3.1
fastify: ^4.13.0
fastify-cron: ^1.3.1
fastify-metrics: ^10.3.0
Expand Down Expand Up @@ -1246,6 +1247,13 @@ __metadata:
languageName: node
linkType: hard

"dotenv@npm:^16.3.1":
version: 16.3.1
resolution: "dotenv@npm:16.3.1"
checksum: 15d75e7279018f4bafd0ee9706593dd14455ddb71b3bcba9c52574460b7ccaf67d5cf8b2c08a5af1a9da6db36c956a04a1192b101ee102a3e0cf8817bbcf3dfd
languageName: node
linkType: hard

"dottie@npm:^2.0.4":
version: 2.0.6
resolution: "dottie@npm:2.0.6"
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ __metadata:
bn.js: ^5.2.0
bs58: ^4.0.1
deep-equal: ^2.2.2
dotenv: ^16.3.1
fastify: ^4.13.0
fastify-cron: ^1.3.1
fastify-metrics: ^10.3.0
Expand Down

0 comments on commit d102547

Please sign in to comment.