FIX: increase sleeps to avoid too many sql queries per hour
This commit is contained in:
parent
733ed25f02
commit
ab4e57b0ce
@ -141,7 +141,7 @@ createConnection({
|
||||
const responseGetblockcount = await client.request("getblockcount", []);
|
||||
|
||||
if (+responseGetblockcount.result <= +keyVal.value) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 5000));
|
||||
await new Promise((resolve) => setTimeout(resolve, 60000));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -158,4 +158,7 @@ createConnection({
|
||||
await KeyValueRepository.save(keyVal);
|
||||
}
|
||||
})
|
||||
.catch((error) => console.log(error));
|
||||
.catch((error) => {
|
||||
console.error("exception in blockprocessor:", error, "comitting suicide");
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@ -145,7 +145,10 @@ createConnection({
|
||||
const end = +new Date();
|
||||
process.env.VERBOSE && console.log("processing mempool took", (end - start) / 1000, "sec");
|
||||
process.env.VERBOSE && console.log("-----------------------");
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
await new Promise((resolve) => setTimeout(resolve, 3000));
|
||||
}
|
||||
})
|
||||
.catch((error) => console.log(error));
|
||||
.catch((error) => {
|
||||
console.error("exception in mempool processor:", error, "comitting suicide");
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@ -53,7 +53,7 @@ createConnection({
|
||||
while (1) {
|
||||
const record = await sendQueueRepository.findOne();
|
||||
if (!record) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 5000));
|
||||
await new Promise((resolve) => setTimeout(resolve, 7000));
|
||||
continue;
|
||||
}
|
||||
// TODO: we could atomically lock this record via mariadb's GET_LOCK and typeorm's raw query, and that would
|
||||
@ -130,4 +130,7 @@ createConnection({
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => console.log(error));
|
||||
.catch((error) => {
|
||||
console.error("exception in sender:", error, "comitting suicide");
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user