Add constant for log write interval.

usb_log
Christopher Young 2017-04-24 11:08:12 -04:00
rodzic e878afaeb7
commit 80daa0f51a
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -25,6 +25,7 @@ import (
const ( const (
LOG_TIMESTAMP_RESOLUTION = 250 * time.Millisecond LOG_TIMESTAMP_RESOLUTION = 250 * time.Millisecond
LOG_WRITE_INTERVAL = 10 * time.Second
) )
type StratuxTimestamp struct { type StratuxTimestamp struct {
@ -362,7 +363,7 @@ func dataLogWriter(db *sql.DB) {
shutdownDataLogWriter = make(chan bool) shutdownDataLogWriter = make(chan bool)
// The write queue. As data comes in via dataLogChan, it is timestamped and stored. // The write queue. As data comes in via dataLogChan, it is timestamped and stored.
// When writeTicker comes up, the queue is emptied. // When writeTicker comes up, the queue is emptied.
writeTicker := time.NewTicker(10 * time.Second) writeTicker := time.NewTicker(LOG_WRITE_INTERVAL)
rowsQueuedForWrite := make([]DataLogRow, 0) rowsQueuedForWrite := make([]DataLogRow, 0)
for { for {
select { select {