mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +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:
		
							parent
							
								
									7878fded6b
								
							
						
					
					
						commit
						7870555c70
					
				@ -1,4 +1,4 @@
 | 
				
			|||||||
import { IEvent, IBaseEvent } from '../types/events';
 | 
					import { IEvent, IBaseEvent, SEGMENT_UPDATED } from '../types/events';
 | 
				
			||||||
import { LogProvider, Logger } from '../logger';
 | 
					import { LogProvider, Logger } from '../logger';
 | 
				
			||||||
import { IEventStore } from '../types/stores/event-store';
 | 
					import { IEventStore } from '../types/stores/event-store';
 | 
				
			||||||
import { ITag } from '../types/model';
 | 
					import { ITag } from '../types/model';
 | 
				
			||||||
@ -159,7 +159,7 @@ class EventStore implements IEventStore {
 | 
				
			|||||||
        const row = await this.db(TABLE)
 | 
					        const row = await this.db(TABLE)
 | 
				
			||||||
            .max('id')
 | 
					            .max('id')
 | 
				
			||||||
            .whereNotNull('feature_name')
 | 
					            .whereNotNull('feature_name')
 | 
				
			||||||
            .orWhere('type', 'segment-update')
 | 
					            .orWhere('type', SEGMENT_UPDATED)
 | 
				
			||||||
            .andWhere('id', '>=', largerThan)
 | 
					            .andWhere('id', '>=', largerThan)
 | 
				
			||||||
            .first();
 | 
					            .first();
 | 
				
			||||||
        return row ? row.max : -1;
 | 
					        return row ? row.max : -1;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user