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