diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-05-30 20:24:57 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-05-30 20:24:57 -0700 |
| commit | 0301504184fa3342624c70b9066dfbfb7944af25 (patch) | |
| tree | cafb52daf1659a5fd28fdc0e0bc58d328f62178b /weed/filer2/abstract_sql | |
| parent | 26e7cd8c7537dc010e6757060c1835a342fffc90 (diff) | |
| download | seaweedfs-0301504184fa3342624c70b9066dfbfb7944af25.tar.xz seaweedfs-0301504184fa3342624c70b9066dfbfb7944af25.zip | |
add mime, use simple insert and update filer store API
1. add mime type to file in filer
2. purge old chunks if overwrite during insert
Diffstat (limited to 'weed/filer2/abstract_sql')
| -rw-r--r-- | weed/filer2/abstract_sql/abstract_sql_store.go | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/weed/filer2/abstract_sql/abstract_sql_store.go b/weed/filer2/abstract_sql/abstract_sql_store.go index aa3b82c5b..82ef571b6 100644 --- a/weed/filer2/abstract_sql/abstract_sql_store.go +++ b/weed/filer2/abstract_sql/abstract_sql_store.go @@ -77,26 +77,21 @@ func (store *AbstractSqlStore) FindEntry(fullpath filer2.FullPath) (*filer2.Entr return entry, nil } -func (store *AbstractSqlStore) DeleteEntry(fullpath filer2.FullPath) (*filer2.Entry, error) { - - entry, err := store.FindEntry(fullpath) - if err != nil { - return nil, nil - } +func (store *AbstractSqlStore) DeleteEntry(fullpath filer2.FullPath) (error) { dir, name := fullpath.DirAndName() res, err := store.DB.Exec(store.SqlDelete, hashToLong(dir), name, dir) if err != nil { - return nil, fmt.Errorf("delete %s: %s", fullpath, err) + return fmt.Errorf("delete %s: %s", fullpath, err) } _, err = res.RowsAffected() if err != nil { - return nil, fmt.Errorf("delete %s but no rows affected: %s", fullpath, err) + return fmt.Errorf("delete %s but no rows affected: %s", fullpath, err) } - return entry, nil + return nil } func (store *AbstractSqlStore) ListDirectoryEntries(fullpath filer2.FullPath, startFileName string, inclusive bool, limit int) (entries []*filer2.Entry, err error) { |
