Skip to content

Commit a866955

Browse files
committed
Add comment explaining why we need to wait for trigger().
Toward rocicorp/replicache#570
1 parent 593b4c2 commit a866955

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pages/api/replicache-push.ts

+2
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
239239
});
240240

241241
const t2 = Date.now();
242+
// We need to await here otherwise, Next.js will frequently kill the request
243+
// and the poke won't get sent.
242244
await pusher.trigger("default", "poke", {});
243245
console.log("Sent poke in", Date.now() - t2);
244246

0 commit comments

Comments
 (0)