Skip to content

Commit

Permalink
update status even if there is no data in chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed Aug 14, 2023
1 parent dcc31a5 commit 0288641
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions file-store/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ export class Database<T extends Tables, D extends Dest> implements FinalDatabase

if (
chunkSize >= this.chunkSize * 1024 * 1024 ||
(info.isOnTop && chunkSize > 0 && newState.height - prevState.height >= this.updateInterval)
(info.isOnTop && newState.height - prevState.height >= this.updateInterval)
) {
await this.flush(prevState, newState, this.chunk)
if (chunkSize > 0) {
await this.flush(prevState, newState, this.chunk)
}
await this.hooks.onStateUpdate(this.dest, newState)
this.state = newState
}
Expand Down

0 comments on commit 0288641

Please sign in to comment.