|
|
@ -65,8 +65,8 @@ var UpdateBranchAsyncInterval = 200 * time.Millisecond |
|
|
var updateBranchAsyncChan chan branchStatus = make(chan branchStatus, 1000) |
|
|
var updateBranchAsyncChan chan branchStatus = make(chan branchStatus, 1000) |
|
|
|
|
|
|
|
|
func updateBranchAsync() { |
|
|
func updateBranchAsync() { |
|
|
defer dtmutil.RecoverPanic(nil) |
|
|
flushBranchs := func() { |
|
|
for { // flush branches every second
|
|
|
defer dtmutil.RecoverPanic(nil) |
|
|
updates := []TransBranch{} |
|
|
updates := []TransBranch{} |
|
|
started := time.Now() |
|
|
started := time.Now() |
|
|
checkInterval := 20 * time.Millisecond |
|
|
checkInterval := 20 * time.Millisecond |
|
|
@ -93,5 +93,9 @@ func updateBranchAsync() { |
|
|
updates = []TransBranch{} |
|
|
updates = []TransBranch{} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
for { // flush branches every 200ms
|
|
|
|
|
|
flushBranchs() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|