From b25009cde7d948dc581de67443d84f1b89241d08 Mon Sep 17 00:00:00 2001 From: Student414 <805447391@qq.com> Date: Wed, 6 Jan 2021 14:20:15 +0800 Subject: [PATCH] Fix: unnecessary write operation on provider (#1170) --- adapters/provider/fetcher.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/adapters/provider/fetcher.go b/adapters/provider/fetcher.go index c0f18c012..1e2551186 100644 --- a/adapters/provider/fetcher.go +++ b/adapters/provider/fetcher.go @@ -108,8 +108,10 @@ func (f *fetcher) Update() (interface{}, bool, error) { return nil, false, err } - if err := safeWrite(f.vehicle.Path(), buf); err != nil { - return nil, false, err + if f.vehicle.Type() != File { + if err := safeWrite(f.vehicle.Path(), buf); err != nil { + return nil, false, err + } } f.updatedAt = &now