Browse Source

serialize sqlite operations

fix https://github.com/seaweedfs/seaweedfs/issues/3827
pull/3834/head
chrislu 2 years ago
parent
commit
cea73ac008
  1. 2
      weed/filer/sqlite/sqlite_store.go

2
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) 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 { if err = store.CreateTable(context.Background(), abstract_sql.DEFAULT_TABLE); err != nil {
return fmt.Errorf("init table %s: %v", abstract_sql.DEFAULT_TABLE, err) return fmt.Errorf("init table %s: %v", abstract_sql.DEFAULT_TABLE, err)
} }

Loading…
Cancel
Save