Skip to content

Commit

Permalink
fix(buddybook): timestamp out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
danisharora099 committed Nov 14, 2024
1 parent a65d721 commit e7c7ba5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/buddybook/src/lib/waku.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function createMessage({
}

export async function* getMessagesFromStore(node: LightNode) {
const startTime = Math.ceil(Date.now() / 1000);
const startTime = Math.floor(Date.now() / 1000);
try {
for await (const messagePromises of node.store.queryGenerator([decoder])) {
const messages = await Promise.all(messagePromises);
Expand All @@ -83,7 +83,7 @@ export async function* getMessagesFromStore(node: LightNode) {
yield blockPayload;
}
}
const endTime = Math.ceil(Date.now() / 1000);
const endTime = Math.floor(Date.now() / 1000);
const timeTaken = endTime - startTime;
console.log("getMessagesFromStore", timeTaken)

Expand All @@ -94,7 +94,7 @@ export async function* getMessagesFromStore(node: LightNode) {
timeTaken,
}));
} catch(e) {
const endTime = Math.ceil(Date.now() / 1000);
const endTime = Math.floor(Date.now() / 1000);
const timeTaken = endTime - startTime;
Telemetry.push([{
type: TelemetryType.LIGHT_PUSH_FILTER,
Expand Down Expand Up @@ -128,7 +128,7 @@ export async function subscribeToFilter(node: LightNode, callback: (message: Blo
result,
node,
decoder,
timestamp: Math.ceil(Date.now() / 1000),
timestamp: Math.floor(Date.now() / 1000),
}));

const {error, subscription, results} = result;
Expand Down

0 comments on commit e7c7ba5

Please sign in to comment.