瀏覽代碼

Maybe fix backfilling multiple batches within deferred backfill

Might fix #471
Tulir Asokan 3 年之前
父節點
當前提交
3933b743e7
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      historysync.go

+ 2 - 2
historysync.go

@@ -142,8 +142,8 @@ func (user *User) createOrUpdatePortalAndBackfillWithLock(req *database.Backfill
 			msgs = toBackfill
 			toBackfill = toBackfill[0:0]
 		} else {
-			msgs = toBackfill[len(toBackfill)-req.MaxBatchEvents:]
-			toBackfill = toBackfill[:len(toBackfill)-req.MaxBatchEvents]
+			msgs = toBackfill[:len(toBackfill)-req.MaxBatchEvents]
+			toBackfill = toBackfill[len(toBackfill)-req.MaxBatchEvents:]
 		}
 
 		if len(msgs) > 0 {