use env var for db path
This commit is contained in:
parent
3f45e0fbc0
commit
df5af22755
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