-
-
Save Ashoat/220bb35da34ac7820867ac874d87beab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/keyserver/src/fetchers/thread-fetchers.js b/keyserver/src/fetchers/thread-fetchers.js | |
index 7f306b2b0..c46c38ba3 100644 | |
--- a/keyserver/src/fetchers/thread-fetchers.js | |
+++ b/keyserver/src/fetchers/thread-fetchers.js | |
@@ -19,7 +19,7 @@ import { | |
import { ServerError } from 'lib/utils/errors.js'; | |
import { getUploadURL } from './upload-fetchers.js'; | |
-import { dbQuery, SQL, mergeAndConditions } from '../database/database.js'; | |
+import { dbQuery, SQL, mergeAndConditions, rawSQL } from '../database/database.js'; | |
import type { SQLStatementType } from '../database/types.js'; | |
import type { Viewer } from '../session/viewer.js'; | |
@@ -120,6 +120,8 @@ async function fetchServerThreadInfos( | |
) | |
.append(whereClause) | |
.append(SQL` ORDER BY m.user ASC`); | |
+ console.log(`threadsQuery: ${rawSQL(threadsQuery)}`); | |
+ console.log(`rolesQuery: ${rawSQL(rolesQuery)}`); | |
const [[threadsResult], [rolesResult]] = await Promise.all([ | |
dbQuery(threadsQuery), | |
dbQuery(rolesQuery), | |
diff --git a/keyserver/src/responders/website-responders.js b/keyserver/src/responders/website-responders.js | |
index d114cec78..651f7baab 100644 | |
--- a/keyserver/src/responders/website-responders.js | |
+++ b/keyserver/src/responders/website-responders.js | |
@@ -310,7 +310,12 @@ async function websiteResponder( | |
const initialTime = Date.now(); | |
const assetInfoPromise = getAssetInfo(); | |
- const threadInfoPromise = fetchThreadInfos(viewer); | |
+ const threadInfoPromise = (async () => { | |
+ const start = Date.now(); | |
+ const result = await fetchThreadInfos(viewer); | |
+ console.log(`threadsInfos fetch took ${Date.now() - start}ms`); | |
+ return result; | |
+ })(); | |
const messageInfoPromise = fetchMessageInfos( | |
viewer, | |
messageSelectionCriteria, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment