Skip to content

Commit

Permalink
removed old flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Griesbacher committed Sep 22, 2016
1 parent f4548f5 commit 92c4d89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions target/influx/Connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ func ConnectorFactory(jobs chan collector.Printable, connectionHost, connectionA
}

gen := WorkerGenerator(jobs, connectionHost + "/write?" + connectionArgs, dumpFile, version, s, data.InfluxDB)
s.TestIfIsAlive(true)
s.TestIfIsAlive()
if !s.isAlive {
s.log.Info("Waiting for InfluxDB server")
}
for !s.isAlive {
s.TestIfIsAlive(true)
s.TestIfIsAlive()
time.Sleep(time.Duration(5) * time.Second)
s.log.Debugln("Waiting for InfluxDB server")
}
Expand Down Expand Up @@ -159,13 +159,11 @@ func (connector *Connector) run() {
}

//TestIfIsAlive test active if the database system is alive.
func (connector *Connector) TestIfIsAlive(initRun bool) bool {
func (connector *Connector) TestIfIsAlive() bool {
result := helper.RequestedReturnCodeIsOK(connector.httpClient, connector.connectionHost + "/ping", "GET")
connector.isAlive = result
if !initRun {
connector.log.Infof("Is InfluxDB running: %t", result)
config.PauseNagflux.Store(!result)
}
connector.log.Infof("Is InfluxDB running: %t", result)
config.PauseNagflux.Store(!result)
return result
}

Expand Down
4 changes: 2 additions & 2 deletions target/influx/Worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (worker Worker) run() {
}
} else {
//Test Influxdb
worker.connector.TestIfIsAlive(false)
worker.connector.TestIfIsAlive()
worker.log.Critical("InfluxDB is not running, waiting for the end to come")
if worker.waitForExternalQuit() {
return
Expand Down Expand Up @@ -148,7 +148,7 @@ func (worker Worker) sendBuffer(queries []collector.Printable) {
startTime := time.Now()
sendErr := worker.sendData([]byte(dataToSend), true)
if sendErr != nil {
worker.connector.TestIfIsAlive(false)
worker.connector.TestIfIsAlive()
worker.connector.TestDatabaseExists()
for i := 0; i < 3; i++ {
switch sendErr {
Expand Down

0 comments on commit 92c4d89

Please sign in to comment.