mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-30 03:51:56 +00:00
chore: add timeout and sequence retrigger
This commit is contained in:
@@ -100,9 +100,12 @@ export class Store<T extends { [key: string]: any }> {
|
||||
|
||||
update(update: Update<T>): void {
|
||||
if (this.isRevision(update)) {
|
||||
// if old or known, return
|
||||
if (update.id <= this.cache.sequence || this.stash.get(update.id)) return
|
||||
this.handleRevision(update)
|
||||
// if old or known, re-trigger the latest revision
|
||||
if (update.id <= this.cache.sequence || this.stash.get(update.id)) {
|
||||
this.updateSequence(this.cache.sequence)
|
||||
} else {
|
||||
this.handleRevision(update)
|
||||
}
|
||||
} else {
|
||||
this.handleDump(update)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user