From 08d25c992b717549f7aca0014fc486f626cc6028 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Tue, 24 Sep 2024 17:29:00 +0530 Subject: [PATCH] fix: stats --- ee/src/main/java/io/supertokens/ee/EEFeatureFlag.java | 2 +- src/main/java/io/supertokens/inmemorydb/Start.java | 1 - .../java/io/supertokens/inmemorydb/queries/OAuthQueries.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ee/src/main/java/io/supertokens/ee/EEFeatureFlag.java b/ee/src/main/java/io/supertokens/ee/EEFeatureFlag.java index 40e64a2c5..e01b8ed26 100644 --- a/ee/src/main/java/io/supertokens/ee/EEFeatureFlag.java +++ b/ee/src/main/java/io/supertokens/ee/EEFeatureFlag.java @@ -347,7 +347,7 @@ private JsonObject getOAuthStats() throws StorageQueryException, TenantOrAppNotF this.appIdentifier.getAsPublicTenantIdentifier(), main)); result.addProperty("totalNumberOfClients", oAuthStorage.countTotalNumberOfClientsForApp(appIdentifier)); - result.addProperty("numberOfClientCredentialsOnlyClients", oAuthStorage.countTotalNumberOfClientsForApp(appIdentifier)); + result.addProperty("numberOfClientCredentialsOnlyClients", oAuthStorage.countTotalNumberOfClientCredentialsOnlyClientsForApp(appIdentifier)); result.addProperty("numberOfM2MTokensAlive", oAuthStorage.countTotalNumberOfM2MTokensAlive(appIdentifier)); long now = System.currentTimeMillis(); diff --git a/src/main/java/io/supertokens/inmemorydb/Start.java b/src/main/java/io/supertokens/inmemorydb/Start.java index c141873f9..288e6593e 100644 --- a/src/main/java/io/supertokens/inmemorydb/Start.java +++ b/src/main/java/io/supertokens/inmemorydb/Start.java @@ -106,7 +106,6 @@ public class Start ActiveUsersSQLStorage, DashboardSQLStorage, AuthRecipeSQLStorage, OAuthSQLStorage { private static final Object appenderLock = new Object(); - private static final String APP_ID_KEY_NAME = "app_id"; private static final String ACCESS_TOKEN_SIGNING_KEY_NAME = "access_token_signing_key"; private static final String REFRESH_TOKEN_KEY_NAME = "refresh_token_key"; public static boolean isTesting = false; diff --git a/src/main/java/io/supertokens/inmemorydb/queries/OAuthQueries.java b/src/main/java/io/supertokens/inmemorydb/queries/OAuthQueries.java index 5b6c8ef23..5a27ee8d5 100644 --- a/src/main/java/io/supertokens/inmemorydb/queries/OAuthQueries.java +++ b/src/main/java/io/supertokens/inmemorydb/queries/OAuthQueries.java @@ -224,7 +224,7 @@ public static int countTotalNumberOfM2MTokensAlive(Start start, AppIdentifier ap " WHERE app_id = ? AND exp > ?"; return execute(start, QUERY, pst -> { pst.setString(1, appIdentifier.getAppId()); - pst.setLong(2, System.currentTimeMillis()); + pst.setLong(2, System.currentTimeMillis()/1000); }, result -> { if (result.next()) { return result.getInt("c");