From cea73ac00818c08db807bf0121188f2ac926dc0f Mon Sep 17 00:00:00 2001 From: chrislu Date: Wed, 12 Oct 2022 00:03:27 -0700 Subject: [PATCH] serialize sqlite operations fix https://github.com/seaweedfs/seaweedfs/issues/3827 --- weed/filer/sqlite/sqlite_store.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/weed/filer/sqlite/sqlite_store.go b/weed/filer/sqlite/sqlite_store.go index 202834fa2..6c9ca4ecc 100644 --- a/weed/filer/sqlite/sqlite_store.go +++ b/weed/filer/sqlite/sqlite_store.go @@ -74,6 +74,8 @@ func (store *SqliteStore) initialize(dbFile, createTable, upsertQuery string) (e return fmt.Errorf("connect to %s error:%v", dbFile, err) } + store.DB.SetMaxOpenConns(1) + if err = store.CreateTable(context.Background(), abstract_sql.DEFAULT_TABLE); err != nil { return fmt.Errorf("init table %s: %v", abstract_sql.DEFAULT_TABLE, err) }