Skip to content

Commit

Permalink
Remove sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
aboodman committed Dec 29, 2021
1 parent 54b0d75 commit 4b87f00
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pages/d/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { PushMessage, PushBody } from "../../protocol/push";
import { resolver } from "frontend/resolver";
import { downstreamSchema } from "protocol/down";
import { NullableVersion, nullableVersionSchema } from "backend/types/version";
import { sleep } from "util/test-utils";
import { GapTracker } from "util/gap-tracker";
import { LogContext } from "util/logger";
import { nanoid } from "nanoid";
Expand Down Expand Up @@ -60,9 +59,7 @@ export default function Home() {
if (newMutations.length > 0) {
pushBody.mutations = newMutations;
pushTracker.push(performance.now());
sleep(2000).then(() => {
ws.send(JSON.stringify(msg));
});
ws.send(JSON.stringify(msg));
}

return {
Expand Down Expand Up @@ -102,7 +99,6 @@ export default function Home() {
baseCookie === null ? "" : String(baseCookie)
);
url.searchParams.set("ts", String(performance.now()));
await sleep(2000);
const ws = new WebSocket(url.toString());
const { promise, resolve } = resolver<WebSocket>();
ws.addEventListener("open", () => {
Expand Down

0 comments on commit 4b87f00

Please sign in to comment.