From b1fe878eb5908f9f90cb2d9747bed6b2ad69059d Mon Sep 17 00:00:00 2001 From: free will <2647778488@qq.com> Date: Mon, 30 May 2022 17:29:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0RoutingTable=E4=B8=AD?= =?UTF-8?q?=E5=85=B3=E4=BA=8E=E4=BB=BB=E5=8A=A1=E8=B0=83=E5=BA=A6=E7=9A=84?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- route/RoutingTable.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/route/RoutingTable.go b/route/RoutingTable.go index 6238e93..639ec36 100644 --- a/route/RoutingTable.go +++ b/route/RoutingTable.go @@ -123,10 +123,12 @@ func (t *RoutingTable) FindRoutingTableEntry(destRouter *component.Identifier) * func (t *RoutingTable) ScheduleRoutingTableCalculation() error { if !t.m_isRouteCalculationScheduled { common2.LogInfo("Scheduling routing table calculation in ", t.m_routingCalcInterval) - err := t.scheduler.ScheduleTaskAfterDuration(t.m_routingCalcInterval, t.Calculate) + job, err := t.scheduler.ScheduleTaskAfterDuration(t.m_routingCalcInterval, 1).Do(t.Calculate) if err != nil { return err } + job.LimitRunsTo(1) + t.scheduler.StartAsync() t.m_isRouteCalculationScheduled = true } return nil