raftstore: remove schedule empty apply task
@@ -1145,6 +1145,7 @@ impl<T: Transport, C: PdClient> Store<T, C> {
self.raft_metrics.ready.snapshot - previous_ready_metrics.snapshot
);
+ if !ready_results.is_empty() {
let mut apply_tasks = Vec::with_capacity(ready_results.len());
for (region_id, ready, res) in ready_results {
self.region_peers
@@ -1158,6 +1159,7 @@ impl<T: Transport, C: PdClient> Store<T, C> {
self.apply_worker
.schedule(ApplyTask::applies(apply_tasks))
.unwrap();
+ }
let dur = t.elapsed();
if !self.is_busy {
