From 81188f68a7e2f573ef7ce0f510553e4f9ad5fbce Mon Sep 17 00:00:00 2001 From: NatureFreshMilk Date: Thu, 24 Jan 2019 10:09:31 +0100 Subject: [PATCH] db limit --- server/mapobjectdb/sqlite_tiles.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/mapobjectdb/sqlite_tiles.go b/server/mapobjectdb/sqlite_tiles.go index b341005..db04c3f 100644 --- a/server/mapobjectdb/sqlite_tiles.go +++ b/server/mapobjectdb/sqlite_tiles.go @@ -70,6 +70,8 @@ func (db *Sqlite3Accessor) RemoveTile(pos *coords.TileCoords) error { func NewSqliteAccessor(filename string) (*Sqlite3Accessor, error) { //TODO: flag/config for unsafe db access db, err := sql.Open("sqlite3", filename+"?_timeout=500&_journal_mode=MEMORY&_synchronous=OFF") + db.SetMaxOpenConns(1) + if err != nil { return nil, err }