Skip to content
This repository has been archived by the owner on Dec 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #35 from nre-learning/influx-fix
Browse files Browse the repository at this point in the history
Retry influx connection instead of existing on first failure.
  • Loading branch information
Mierdin authored Dec 6, 2018
2 parents 278a046 + 9b84f29 commit 0b28063
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Consolidate lesson definition logic, and provide local validation tool (syrctl) [#30](https://github.com/nre-learning/syringe/pull/30)
- Redesign and fix the way iframe resources are created and presented to the API[#32](https://github.com/nre-learning/syringe/pull/32)
- Keep trying to serve metrics after an influxdb connection failure, instead of returning immediately [#35](https://github.com/nre-learning/syringe/pull/35)
- Migrate to `dep` for dependency management [#36](https://github.com/nre-learning/syringe/pull/36)

## 0.1.3 - November 15, 2018
Expand Down
6 changes: 3 additions & 3 deletions api/exp/influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (s *server) startTSDBExport() error {
})
if err != nil {
log.Error("Couldn't connect to Influxdb: ", err)
return err
continue
}

for lessonId, _ := range s.scheduler.LessonDefs {
Expand All @@ -135,7 +135,7 @@ func (s *server) startTSDBExport() error {
pt, err := influx.NewPoint("sessionStatus", tags, fields, time.Now())
if err != nil {
log.Error("Error creating InfluxDB Point: ", err)
return err
continue
}

bp.AddPoint(pt)
Expand All @@ -146,7 +146,7 @@ func (s *server) startTSDBExport() error {
err = c.Write(bp)
if err != nil {
log.Error("Error writing InfluxDB Batch Points: ", err)
return err
continue
}

log.Debugf("Wrote session data to influxdb: %v", bp)
Expand Down

0 comments on commit 0b28063

Please # to comment.