Skip to content

Commit 5cc736e

Browse files
committed
whitelist map for cors, reduce sending to 100ms
1 parent 0175163 commit 5cc736e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ app
4242
"https://meshtastic.org",
4343
"https://flash.meshtastic.org",
4444
"https://flasher.meshtastic.org",
45+
"https://map.meshtastic.org",
4546
];
4647

4748
// return origin if it is in the whitelist

src/services/gateway.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { GatewayStreamResponse } from "@buf/meshtastic_api.bufbuild_es/protobufs
44
import type { GatewayService } from "@buf/meshtastic_api.connectrpc_es/protobufs/gateway/v1/gateway_service_connect.js";
55
import { prisma } from "../lib/index.js";
66
import { Timestamp } from "@bufbuild/protobuf";
7-
import { Channel } from "@prisma/client";
7+
import type { Channel } from "@prisma/client";
88

99
export class Gateway implements ServiceImpl<typeof GatewayService> {
1010
public async *gatewayStream(): AsyncGenerator<GatewayStreamResponse> {
@@ -22,9 +22,8 @@ export class Gateway implements ServiceImpl<typeof GatewayService> {
2222
});
2323

2424
for (const gateway of gateways) {
25-
console.log("sending gateway", gateway.id);
2625
//delay for 1 second
27-
await new Promise((resolve) => setTimeout(resolve, 1000));
26+
await new Promise((resolve) => setTimeout(resolve, 100));
2827
yield new GatewayStreamResponse({
2928
gateway: {
3029
id: gateway.id,

0 commit comments

Comments
 (0)