Simplify Purge() function #234
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
dc23632556
commit
3288ede6e6
1 changed files with 1 additions and 5 deletions
|
@ -110,9 +110,5 @@ func (m File) Changed(fileSize int64, fileModified time.Time) bool {
|
|||
|
||||
// Purge removes a file from the index by marking it as missing.
|
||||
func (m *File) Purge() error {
|
||||
if err := Db().Unscoped().Model(m).Updates(map[string]interface{}{"file_missing": true, "file_primary": false}).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return Db().Unscoped().Model(m).Updates(map[string]interface{}{"file_missing": true, "file_primary": false}).Error
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue