From c203d58440eb02ec2d38b34475ea46fdd61d88d9 Mon Sep 17 00:00:00 2001 From: David McFadzean Date: Thu, 7 Mar 2024 10:16:46 -0500 Subject: [PATCH] Increased JSON payload size to 1MB --- hyperswarm-monitor.js | 2 +- release.sh | 6 ++++++ server.js | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 release.sh diff --git a/hyperswarm-monitor.js b/hyperswarm-monitor.js index 10c0c4bc..f8fca2f3 100644 --- a/hyperswarm-monitor.js +++ b/hyperswarm-monitor.js @@ -101,7 +101,7 @@ async function mergeDb(db) { console.log(`Adding to batch: ${did} ${db.hyperswarm[did][0].time}`); batch.push(db.hyperswarm[did]); - if (batch.length >= 25) { + if (batch.length >= 100) { try { const imported = await gatekeeper.mergeBatch(batch); if (imported > 0) { diff --git a/release.sh b/release.sh new file mode 100644 index 00000000..beef5a6d --- /dev/null +++ b/release.sh @@ -0,0 +1,6 @@ +git checkout release +git pull +git merge main +git push +git checkout main + diff --git a/server.js b/server.js index 8856ae60..eac906b4 100644 --- a/server.js +++ b/server.js @@ -10,7 +10,7 @@ gatekeeper.start(); const app = express(); app.use(morgan('dev')); -app.use(express.json()); +app.use(express.json({ limit: '1mb' })); // Sets the JSON payload limit to 1MB app.get('/version', async (req, res) => { try {