use primary for reading eventbuffer
This commit is contained in:
@@ -245,13 +245,16 @@ export class EventBuffer extends BaseBuffer {
|
|||||||
projectId: string;
|
projectId: string;
|
||||||
profileId: string;
|
profileId: string;
|
||||||
}): Promise<IServiceEvent | null> {
|
}): Promise<IServiceEvent | null> {
|
||||||
const event = await db.eventBuffer.findFirst({
|
const event = await db.$primary().eventBuffer.findFirst({
|
||||||
where: {
|
where: {
|
||||||
projectId,
|
projectId,
|
||||||
profileId,
|
profileId,
|
||||||
name: 'screen_view',
|
name: 'screen_view',
|
||||||
},
|
},
|
||||||
orderBy: { createdAt: 'desc' },
|
orderBy: { createdAt: 'desc' },
|
||||||
|
select: {
|
||||||
|
payload: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
|
|||||||
@@ -122,6 +122,11 @@ export class ProfileBuffer extends BaseBuffer {
|
|||||||
orderBy: {
|
orderBy: {
|
||||||
createdAt: 'desc',
|
createdAt: 'desc',
|
||||||
},
|
},
|
||||||
|
select: {
|
||||||
|
checksum: true,
|
||||||
|
payload: true,
|
||||||
|
id: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Last item in buffer is the same as the new profile
|
// Last item in buffer is the same as the new profile
|
||||||
|
|||||||
Reference in New Issue
Block a user