Skip to content

Commit 02777ea

Browse files
authored
fix: Node socket hangup error (#293)
Increase timeout of this request to 10 minutes Specify this value should be decreased for PROT-187 (cache implementation) Add a note in README for the latency
1 parent 3d04d0d commit 02777ea

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/request-node/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ curl -i "http://localhost:3000/getTransactionsByTopic?topic=topicExample"
9494
| 422 | The input fields of the request are incorrect |
9595
| 500 | The getTransactionsByTopic operation from DataAccess fails |
9696

97+
##### Note
98+
99+
Since the Node doesn't implement a cache yet, all transactions have to be retrieved directly on IPFS.
100+
As a consequence, this request can take a long time if the topic requested indexes many transactions.
101+
This delay will be optimized with the implementation of a cache.
102+
97103
## Deployment
98104

99105
A Node can be deployed by anyone. Users interested by running their own node can do it with the following instructions:

packages/request-node/src/request/getTransactionsByTopic.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { DataAccess } from '@requestnetwork/data-access';
22
import * as httpStatus from 'http-status-codes';
33

4+
const REQUEST_TIMEOUT: number = 600000;
5+
46
/**
57
* Action to handle getTransactionsByTopic of data-access layer.
68
*/
@@ -13,6 +15,11 @@ export default {
1315
// Retrieves data access layer
1416
let transactions;
1517

18+
// As the Node doesn't implement a cache, all transactions have to be retrieved directly on IPFS
19+
// This operation can take a long time and then the timeout of the request should be increase
20+
// PROT-187: Decrease or remove this value
21+
clientRequest.setTimeout(REQUEST_TIMEOUT);
22+
1623
// Server accept json message
1724
clientRequest.accepts('json');
1825

0 commit comments

Comments
 (0)