ensure tables are created

fix https://github.com/chrislusf/seaweedfs/issues/1957
This commit is contained in:
Chris Lu 2021-04-02 12:02:26 -07:00
parent 319743d330
commit 5e64f65632

View file

@ -36,6 +36,8 @@ func (store *AbstractSqlStore) OnBucketCreation(bucket string) {
store.dbsLock.Lock() store.dbsLock.Lock()
defer store.dbsLock.Unlock() defer store.dbsLock.Unlock()
store.CreateTable(context.Background(), bucket)
if store.dbs == nil { if store.dbs == nil {
return return
} }
@ -45,6 +47,8 @@ func (store *AbstractSqlStore) OnBucketDeletion(bucket string) {
store.dbsLock.Lock() store.dbsLock.Lock()
defer store.dbsLock.Unlock() defer store.dbsLock.Unlock()
store.deleteTable(context.Background(), bucket)
if store.dbs == nil { if store.dbs == nil {
return return
} }