remove console.time
This commit is contained in:
@@ -28,10 +28,6 @@ export class TimelineMessagingService {
|
||||
page: number = 1,
|
||||
pageSize: number = TIMELINE_THREADS_DEFAULT_PAGE_SIZE,
|
||||
): Promise<TimelineThreadsWithTotal> {
|
||||
console.time(
|
||||
`getMessagesFromPersonIds for workspaceId: ${workspaceId} and personIds: ${personIds}`,
|
||||
);
|
||||
|
||||
const offset = (page - 1) * pageSize;
|
||||
|
||||
const dataSourceMetadata =
|
||||
@@ -42,10 +38,6 @@ export class TimelineMessagingService {
|
||||
const workspaceDataSource =
|
||||
await this.typeORMService.connectToDataSource(dataSourceMetadata);
|
||||
|
||||
console.time(
|
||||
`getMessagesFromPersonIds for workspaceId: ${workspaceId} and personIds: ${personIds} - Querying messageThreads`,
|
||||
);
|
||||
|
||||
const messageThreads:
|
||||
| {
|
||||
id: string;
|
||||
@@ -83,10 +75,6 @@ export class TimelineMessagingService {
|
||||
[personIds, pageSize, offset],
|
||||
);
|
||||
|
||||
console.timeEnd(
|
||||
`getMessagesFromPersonIds for workspaceId: ${workspaceId} and personIds: ${personIds} - Querying messageThreads`,
|
||||
);
|
||||
|
||||
if (!messageThreads) {
|
||||
return {
|
||||
totalNumberOfThreads: 0,
|
||||
@@ -98,10 +86,6 @@ export class TimelineMessagingService {
|
||||
(messageThread) => messageThread.id,
|
||||
);
|
||||
|
||||
console.time(
|
||||
`getMessagesFromPersonIds for workspaceId: ${workspaceId} and personIds: ${personIds} - Querying threadSubjects`,
|
||||
);
|
||||
|
||||
const threadSubjects:
|
||||
| {
|
||||
id: string;
|
||||
@@ -131,14 +115,6 @@ export class TimelineMessagingService {
|
||||
[messageThreadIds],
|
||||
);
|
||||
|
||||
console.timeEnd(
|
||||
`getMessagesFromPersonIds for workspaceId: ${workspaceId} and personIds: ${personIds} - Querying threadSubjects`,
|
||||
);
|
||||
|
||||
console.time(
|
||||
`getMessagesFromPersonIds for workspaceId: ${workspaceId} and personIds: ${personIds} - Querying numberOfMessagesInThread`,
|
||||
);
|
||||
|
||||
const numberOfMessagesInThread:
|
||||
| {
|
||||
id: string;
|
||||
@@ -159,10 +135,6 @@ export class TimelineMessagingService {
|
||||
[messageThreadIds],
|
||||
);
|
||||
|
||||
console.timeEnd(
|
||||
`getMessagesFromPersonIds for workspaceId: ${workspaceId} and personIds: ${personIds} - Querying numberOfMessagesInThread`,
|
||||
);
|
||||
|
||||
const messageThreadsByMessageThreadId: {
|
||||
[key: string]: {
|
||||
id: string;
|
||||
@@ -262,14 +234,6 @@ export class TimelineMessagingService {
|
||||
[messageThreadIds],
|
||||
);
|
||||
|
||||
console.timeEnd(
|
||||
`getMessagesFromPersonIds for workspaceId: ${workspaceId} and personIds: ${personIds} - Querying threadMessagesFromActiveParticipants`,
|
||||
);
|
||||
|
||||
console.time(
|
||||
`getMessagesFromPersonIds for workspaceId: ${workspaceId} and personIds: ${personIds} - Querying totalNumberOfThreads`,
|
||||
);
|
||||
|
||||
const totalNumberOfThreads = await workspaceDataSource?.query(
|
||||
`
|
||||
SELECT COUNT(DISTINCT message."messageThreadId")
|
||||
@@ -345,10 +309,6 @@ export class TimelineMessagingService {
|
||||
return messageThreadIdAcc;
|
||||
}, {});
|
||||
|
||||
console.time(
|
||||
`getMessagesFromPersonIds for workspaceId: ${workspaceId} and personIds: ${personIds} - Querying threadVisibility`,
|
||||
);
|
||||
|
||||
const threadVisibility:
|
||||
| {
|
||||
id: string;
|
||||
@@ -452,10 +412,6 @@ export class TimelineMessagingService {
|
||||
};
|
||||
});
|
||||
|
||||
console.timeEnd(
|
||||
`getMessagesFromPersonIds for workspaceId: ${workspaceId} and personIds: ${personIds}`,
|
||||
);
|
||||
|
||||
return {
|
||||
totalNumberOfThreads: totalNumberOfThreads[0]?.count ?? 0,
|
||||
timelineThreads,
|
||||
|
||||
Reference in New Issue
Block a user