db access fixes
This commit is contained in:
parent
44b4eef640
commit
8eca70aa5e
@ -6,7 +6,6 @@ import (
|
||||
)
|
||||
|
||||
func New(filename string) (*Sqlite3Accessor, error) {
|
||||
//TODO: flag/config for unsafe db access
|
||||
db, err := sql.Open("sqlite3", filename+"?_timeout=500")
|
||||
db.SetMaxOpenConns(1)
|
||||
|
||||
|
@ -2,6 +2,7 @@ package sqlite
|
||||
|
||||
const migrateScript = `
|
||||
PRAGMA foreign_keys = ON;
|
||||
PRAGMA journal_mode = TRUNCATE;
|
||||
|
||||
create table if not exists objects(
|
||||
id integer primary key autoincrement,
|
||||
|
@ -36,11 +36,11 @@ func incrementalRender(ctx *app.App, jobs chan *coords.TileCoords) {
|
||||
continue
|
||||
}
|
||||
|
||||
tiles := renderMapblocks(ctx, jobs, result.List)
|
||||
|
||||
lastMtime = result.LastMtime
|
||||
ctx.Settings.SetInt64(settings.SETTING_LAST_MTIME, lastMtime)
|
||||
|
||||
tiles := renderMapblocks(ctx, jobs, result.List)
|
||||
|
||||
t := time.Now()
|
||||
elapsed := t.Sub(start)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user