소스 검색

feat(route-sync): do not run empty batches

Andrew Mayorov 2 년 전
부모
커밋
a28fc7bfa8
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      apps/emqx/src/emqx_router_syncer.erl

+ 4 - 2
apps/emqx/src/emqx_router_syncer.erl

@@ -221,8 +221,10 @@ replyctx_send(Result, {MRef, Pid}) ->
 
 %%
 
-run_batch(Batch) ->
-    emqx_router:do_batch(Batch).
+run_batch(Batch) when map_size(Batch) > 0 ->
+    emqx_router:do_batch(Batch);
+run_batch(_Empty) ->
+    #{}.
 
 %%