Fix: unnecessary write operation on provider (#1170)

This commit is contained in:
Student414 2021-01-06 14:20:15 +08:00 committed by GitHub
parent 6fedd7ec84
commit b25009cde7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,9 +108,11 @@ func (f *fetcher) Update() (interface{}, bool, error) {
return nil, false, err return nil, false, err
} }
if f.vehicle.Type() != File {
if err := safeWrite(f.vehicle.Path(), buf); err != nil { if err := safeWrite(f.vehicle.Path(), buf); err != nil {
return nil, false, err return nil, false, err
} }
}
f.updatedAt = &now f.updatedAt = &now
f.hash = hash f.hash = hash