Sfoglia il codice sorgente

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

Andrew Mayorov 2 anni fa
parent
commit
a28fc7bfa8
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  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) ->
+    #{}.
 
 
 %%
 %%