add parser delay to prevent excessive cpu use
This commit is contained in:
parent
7675418a2a
commit
8d02af4b78
@ -3,6 +3,7 @@ package birdwatcher
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/alice-lg/alice-lg/pkg/api"
|
||||
)
|
||||
@ -65,6 +66,10 @@ func parseRoutesResponseStream(
|
||||
if err := dec.Decode(&rdata); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// Wait a bit, so our CPUs do not go up in flames.
|
||||
time.Sleep(30000 * time.Nanosecond)
|
||||
|
||||
route := parseRouteData(rdata, config, false)
|
||||
routes = append(routes, route)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user