1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: use correct event type for maxRevisionId (#3870)

We had a small typo where we looked for `segment-update` event instead
of `segment-updated`. Changed to use the event constant.
This commit is contained in:
Ivar Conradi Østhus 2023-05-25 23:00:08 +02:00 committed by GitHub
parent 959ac33905
commit 49722d5c48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import { IEvent, IBaseEvent } from '../types/events';
import { IEvent, IBaseEvent, SEGMENT_UPDATED } from '../types/events';
import { LogProvider, Logger } from '../logger';
import { IEventStore } from '../types/stores/event-store';
import { ITag } from '../types/model';
@ -159,7 +159,7 @@ class EventStore implements IEventStore {
const row = await this.db(TABLE)
.max('id')
.whereNotNull('feature_name')
.orWhere('type', 'segment-update')
.orWhere('type', SEGMENT_UPDATED)
.andWhere('id', '>=', largerThan)
.first();
return row ? row.max : -1;