Skip to content

Commit

Permalink
fix: remove os requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
drochetti committed Nov 25, 2023
1 parent b3126a6 commit 9d0bff9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion libs/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fal-ai/serverless-client",
"description": "The fal serverless JS/TS client",
"version": "0.6.0-alpha.0",
"version": "0.6.0-alpha.1",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
7 changes: 4 additions & 3 deletions libs/client/src/realtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ async function getConnection(app: string, key: string): Promise<WebSocket> {
// const token = await getToken(app);
const token = '***';

if (connections.has(key)) {
return connections.get(key) as WebSocket;
const connectionKey = `${key}:${token}`;
if (connections.has(connectionKey)) {
return connections.get(connectionKey) as WebSocket;
}
const ws = new WebSocket(url);
connections.set(key, ws);
connections.set(connectionKey, ws);
return ws;
}

Expand Down
5 changes: 1 addition & 4 deletions libs/client/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ export function getUserAgent(): string {
return memoizedUserAgent;
}
const packageInfo = require('../package.json');
const os = require('os');
memoizedUserAgent = `${packageInfo.name}/${
packageInfo.version
} ${os.platform()}-${os.arch()} ${process.release.name}-${process.version}`;
memoizedUserAgent = `${packageInfo.name}/${packageInfo.version}`;
return memoizedUserAgent;
}
1 change: 1 addition & 0 deletions libs/client/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"module": "commonjs",
"outDir": "../../dist/out-tsc",
"inlineSources": true,
"declaration": true,
"allowJs": true,
"checkJs": false,
Expand Down

0 comments on commit 9d0bff9

Please sign in to comment.