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