Lock thread to database, so it should not crash anymore.
This commit is contained in:
parent
102891c217
commit
def03ee25d
@ -14,6 +14,7 @@ import (
|
||||
//"database/sql"
|
||||
"fmt"
|
||||
"path"
|
||||
"runtime"
|
||||
"strconv"
|
||||
|
||||
// local
|
||||
@ -48,10 +49,12 @@ func (d *Database) Close() {
|
||||
tx.Commit()
|
||||
|
||||
d.Db.Close()
|
||||
runtime.UnlockOSThread()
|
||||
}
|
||||
|
||||
func (d *Database) Initialize(cfg *configuration.Config) {
|
||||
fmt.Println("Initializing database...")
|
||||
runtime.LockOSThread()
|
||||
|
||||
// Connect to database.
|
||||
db_path := path.Join(cfg.TEMP["DATA"], "database.sqlite3")
|
||||
|
Reference in New Issue
Block a user