use env var for db path
This commit is contained in:
parent
6bc4e06c8f
commit
9b480b8d40
4
main.go
4
main.go
|
@ -8,6 +8,7 @@ import (
|
|||
_ "github.com/mattn/go-sqlite3"
|
||||
"log"
|
||||
"math"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
@ -110,9 +111,10 @@ func main() {
|
|||
ulimit = t
|
||||
}
|
||||
|
||||
dbpath := os.Getenv("XBIT_DB")
|
||||
var db TimelineDB
|
||||
var err error
|
||||
db.DB, err = sql.Open("sqlite3", "./timeline.db")
|
||||
db.DB, err = sql.Open("sqlite3", dbpath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue