更新RoutingTable中关于任务调度的语句

This commit is contained in:
free will committed 2022-05-30 17:29:41 +08:00
1 parent 49432f82d1
commit b1fe878eb5
1 file changed
+3 -1
+3 -1
View File
@@ -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