mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 14:18:43 +08:00
Update AppInformationService.js
This commit is contained in:
parent
e263c2be95
commit
68fb7e8291
@ -136,7 +136,7 @@ class AppInformationService {
|
||||
const key_open_count = `apps:open_count:uid:${app_uid}`;
|
||||
let open_count = kv.get(key_open_count);
|
||||
if ( ! open_count ) {
|
||||
if(!global.clickhouseClient) {
|
||||
if(global.clickhouseClient) {
|
||||
const result = await global.clickhouseClient.query({
|
||||
query: `SELECT COUNT(_id) AS open_count FROM app_opens WHERE app_uid = '${app_uid}'`,
|
||||
format: 'JSONEachRow'
|
||||
@ -155,7 +155,7 @@ class AppInformationService {
|
||||
const key_user_count = `apps:user_count:uid:${app_uid}`;
|
||||
let user_count = kv.get(key_user_count);
|
||||
if ( ! user_count ) {
|
||||
if(!global.clickhouseClient) {
|
||||
if(global.clickhouseClient) {
|
||||
const result = await global.clickhouseClient.query({
|
||||
query: `SELECT COUNT(DISTINCT user_id) AS uniqueUsers FROM app_opens WHERE app_uid = '${app_uid}'`,
|
||||
format: 'JSONEachRow'
|
||||
|
Loading…
Reference in New Issue
Block a user