refactor: move timeline scheduler to isolated service
This commit is contained in:
@@ -77,7 +77,15 @@ async function validateSessionFromPeer(peer: any) {
|
||||
}
|
||||
|
||||
async function computeTeamSignature(teamId: string) {
|
||||
const [omniMessageMax, contactMax, contactMessageMax, telegramConnectionMax, contactInboxMax, inboxPrefMax] = await Promise.all([
|
||||
const [
|
||||
omniMessageMax,
|
||||
contactMax,
|
||||
contactMessageMax,
|
||||
telegramConnectionMax,
|
||||
contactInboxMax,
|
||||
inboxPrefMax,
|
||||
clientTimelineEntryMax,
|
||||
] = await Promise.all([
|
||||
prisma.omniMessage.aggregate({
|
||||
where: { teamId },
|
||||
_max: { updatedAt: true },
|
||||
@@ -102,6 +110,10 @@ async function computeTeamSignature(teamId: string) {
|
||||
where: { teamId },
|
||||
_max: { updatedAt: true },
|
||||
}),
|
||||
prisma.clientTimelineEntry.aggregate({
|
||||
where: { teamId },
|
||||
_max: { updatedAt: true },
|
||||
}),
|
||||
]);
|
||||
|
||||
return [
|
||||
@@ -111,6 +123,7 @@ async function computeTeamSignature(teamId: string) {
|
||||
telegramConnectionMax._max.updatedAt?.toISOString() ?? "",
|
||||
contactInboxMax._max.updatedAt?.toISOString() ?? "",
|
||||
inboxPrefMax._max.updatedAt?.toISOString() ?? "",
|
||||
clientTimelineEntryMax._max.updatedAt?.toISOString() ?? "",
|
||||
].join("|");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user