mirror of https://bitbucket.org/ausocean/av.git
cmd/rv/main.go: added delay before running stuff
We were getting problems with connection to RTSP device when revid was started from boot. It seemed like system networking things were not given enough time to establish themselves before we tried to use them. A delay before running revid fixes this, but is a bit of a hacky solution. Better solution would be appreciated.
This commit is contained in:
parent
4d5a85b853
commit
10908a1749
|
@ -102,6 +102,7 @@ const (
|
|||
defaultSleepTime = 60 // Seconds
|
||||
profilePath = "rv.prof"
|
||||
pkg = "rv: "
|
||||
runPreDelay = 20 * time.Second
|
||||
)
|
||||
|
||||
// This is set to true if the 'profile' build tag is provided on build.
|
||||
|
@ -145,6 +146,12 @@ func main() {
|
|||
if err != nil {
|
||||
log.Log(logger.Fatal, pkg+"could not initialise revid", "error", err.Error())
|
||||
}
|
||||
|
||||
// NB: Problems were encountered with communicating with RTSP inputs. When trying to
|
||||
// connect it would fail due to timeout; as if things had not been set up quickly
|
||||
// enough before revid tried to do things. This delay fixes this, but there is probably
|
||||
// a better way to solve this problem.
|
||||
time.Sleep(runPreDelay)
|
||||
|
||||
log.Log(logger.Debug, "beginning main loop")
|
||||
run(rv, ns, log, netLog)
|
||||
|
|
Loading…
Reference in New Issue