Moved runtime.LockOSThread() to urtrator.go.
This commit is contained in:
@@ -14,7 +14,6 @@ import (
|
||||
//"database/sql"
|
||||
"fmt"
|
||||
"path"
|
||||
"runtime"
|
||||
"strconv"
|
||||
|
||||
// local
|
||||
@@ -49,12 +48,10 @@ 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")
|
||||
@@ -75,10 +72,6 @@ func (d *Database) Initialize(cfg *configuration.Config) {
|
||||
}
|
||||
}
|
||||
|
||||
func (d *Database) Lock() {
|
||||
runtime.LockOSThread()
|
||||
}
|
||||
|
||||
func (d *Database) Migrate() {
|
||||
// Getting current database version.
|
||||
dbver := 0
|
||||
@@ -94,7 +87,3 @@ func (d *Database) Migrate() {
|
||||
|
||||
migrate_full(d, dbver)
|
||||
}
|
||||
|
||||
func (d *Database) Unlock() {
|
||||
runtime.UnlockOSThread()
|
||||
}
|
||||
|
Reference in New Issue
Block a user