mirror of
https://gitee.com/willfree/mlsr.git
synced 2026-10-04 19:42:02 +08:00
更新RoutingTable中关于任务调度的语句
This commit is contained in:
1 parent
49432f82d1
commit
b1fe878eb5
1 file changed
+3
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user