Skip to content

Commit

Permalink
timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
dfstio committed Aug 17, 2024
1 parent 89bd168 commit e01d7fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nameservice",
"version": "0.5.24",
"version": "0.5.26",
"author": "@staketab",
"license": "Apache-2.0",
"scripts": {
Expand Down
11 changes: 9 additions & 2 deletions contracts/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ export class DomainNameServiceWorker extends zkCloudWorker {
}): Promise<void> {
try {
const { txs, status, hash } = params;
const statusTime = Date.now();
console.time("published txs status");
if (NATS_SERVER === undefined) {
console.error("NATS_SERVER is undefined");
Expand All @@ -409,7 +410,7 @@ export class DomainNameServiceWorker extends zkCloudWorker {
const js = nc.jetstream({ timeout: 5000 });
const kv = await js.views.kv("profiles", { timeout: 5000 });
for (const tx of txs) {
const data = { ...tx, status, hash };
const data = { ...tx, status, hash, statusTime };
console.log("Publishing tx status", tx.txId, data);
await kv.put(`zkcloudworker.rolluptx.${tx.txId}`, JSON.stringify(data));
}
Expand Down Expand Up @@ -687,6 +688,12 @@ export class DomainNameServiceWorker extends zkCloudWorker {
force: true,
timeout: 5 * 1000,
});
if (!Mina.hasAccount(blockAddress, tokenId)) {
console.error(
`getBlocksInfo: Block ${blockAddress.toBase58()} not found`
);
return `error: Block ${blockAddress.toBase58()} not found`;
}
blockNumber = Number(block.blockNumber.get().toBigInt());
count++;
}
Expand Down Expand Up @@ -2415,7 +2422,7 @@ export class DomainNameServiceWorker extends zkCloudWorker {
return result;
}
}
await sleep(1000 * 5);
await sleep(1000 * 6);
}
if (force === true)
throw new Error(
Expand Down

0 comments on commit e01d7fa

Please sign in to comment.