diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-01-19 17:21:50 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-01-19 17:21:50 -0800 |
| commit | 52a8f1470ef92b9d0075c3dccc76a4170ab30c07 (patch) | |
| tree | 3bae93297aa57eb9b8c1290927f2582c21b4817d /weed/filer/abstract_sql | |
| parent | 93b3adba9864dd278a778ccfe2165bcadb010574 (diff) | |
| download | seaweedfs-52a8f1470ef92b9d0075c3dccc76a4170ab30c07.tar.xz seaweedfs-52a8f1470ef92b9d0075c3dccc76a4170ab30c07.zip | |
filer store: add mysql2
Diffstat (limited to 'weed/filer/abstract_sql')
| -rw-r--r-- | weed/filer/abstract_sql/abstract_sql_store.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/filer/abstract_sql/abstract_sql_store.go b/weed/filer/abstract_sql/abstract_sql_store.go index aada9cd4a..8345d7a7b 100644 --- a/weed/filer/abstract_sql/abstract_sql_store.go +++ b/weed/filer/abstract_sql/abstract_sql_store.go @@ -91,6 +91,8 @@ func (store *AbstractSqlStore) getTxOrDB(ctx context.Context, fullpath util.Full if t < 0 && !isForChildren { return } + bucket = bucketAndObjectKey + shortPath = "/" if t > 0 { bucket = bucketAndObjectKey[:t] shortPath = util.FullPath(bucketAndObjectKey[t:]) @@ -241,11 +243,13 @@ func (store *AbstractSqlStore) DeleteFolderChildren(ctx context.Context, fullpat } if isValidBucket(bucket) && shortPath == "/" { - if err = store.deleteTable(ctx, bucket); err != nil { + if err = store.deleteTable(ctx, bucket); err == nil { store.dbsLock.Lock() delete(store.dbs, bucket) store.dbsLock.Unlock() return nil + } else { + return err } } |
