Skip to content

Commit 620d0ed

Browse files
committed
fix: improve formatting and error handling in shouldSendStartedEvent function
1 parent d9cb6e3 commit 620d0ed

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ process.on("exit", () => {
5050

5151
export { setLogger } from "./logger.js";
5252
export { BrowserStackMcpServer } from "./server-factory.js";
53+
export { trackMCP } from "./lib/instrumentation.js";

src/lib/device-cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export async function getDevicesAndBrowsers(
7070
// Rate limiter for started event (3H)
7171
export function shouldSendStartedEvent(): boolean {
7272
try {
73-
if(config && config.REMOTE_MCP){
73+
if (config && config.REMOTE_MCP) {
7474
return false;
7575
}
7676
if (!fs.existsSync(CACHE_DIR)) {
@@ -88,7 +88,7 @@ export function shouldSendStartedEvent(): boolean {
8888
cache.lastStartedEvent = Date.now();
8989
fs.writeFileSync(CACHE_FILE, JSON.stringify(cache, null, 2), "utf8");
9090
return true;
91-
} catch (e) {
91+
} catch {
9292
return true;
9393
}
9494
}

0 commit comments

Comments
 (0)