Converted global to globalThis.

This commit is contained in:
Mike Cao 2025-04-28 23:05:18 -07:00
parent 886b7e9e56
commit c969603001
9 changed files with 25 additions and 22 deletions

View file

@ -41,7 +41,7 @@ function getClient() {
});
if (process.env.NODE_ENV !== 'production') {
global[CLICKHOUSE] = client;
globalThis[CLICKHOUSE] = client;
}
log('Clickhouse initialized');
@ -219,7 +219,7 @@ async function findFirst(data: any[]) {
async function connect() {
if (enabled && !clickhouse) {
clickhouse = process.env.CLICKHOUSE_URL && (global[CLICKHOUSE] || getClient());
clickhouse = process.env.CLICKHOUSE_URL && (globalThis[CLICKHOUSE] || getClient());
}
return clickhouse;