We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f433ac6 commit a2cfcdbCopy full SHA for a2cfcdb
1 file changed
services/libs/database/src/tinybirdClient.ts
@@ -1,4 +1,5 @@
1
import axios from 'axios'
2
+import https from 'https'
3
4
export type QueryParams = Record<
5
string,
@@ -29,6 +30,10 @@ export class TinybirdClient {
29
30
private host: string
31
private token: string
32
33
+ private static httpsAgent = new https.Agent({
34
+ keepAlive: false, // Disable keep-alive to avoid stale socket reuse
35
+ })
36
+
37
constructor() {
38
this.host = process.env.CROWD_TINYBIRD_BASE_URL ?? 'https://api.tinybird.co'
39
this.token = process.env.CROWD_TINYBIRD_ACTIVITIES_TOKEN ?? ''
@@ -60,6 +65,7 @@ export class TinybirdClient {
60
65
Authorization: `Bearer ${this.token}`,
61
66
Accept: 'application/json',
62
67
},
68
+ httpsAgent: TinybirdClient.httpsAgent,
63
69
})
64
70
71
// TODO: check the response type
0 commit comments