Skip to content

Commit cde851f

Browse files
committed
Improved flushing condition
1 parent ee299b0 commit cde851f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/webapp/app/v3/dynamicFlushScheduler.server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,10 @@ export class DynamicFlushScheduler<T> {
242242

243243
// Don't await here - let them run concurrently
244244
Promise.allSettled(flushPromises).then(() => {
245+
const shouldContinueFlushing =
246+
this.batchQueue.length > 0 && (this.consecutiveFlushFailures < 3 || this.isShuttingDown);
245247
// After flush completes, check if we need to flush more
246-
if (this.batchQueue.length > 0 && !this.isShuttingDown && this.consecutiveFlushFailures < 3) {
248+
if (shouldContinueFlushing) {
247249
this.flushBatches();
248250
}
249251
});

0 commit comments

Comments
 (0)