From c5e5666b6442bc735110f5a5aa5322edf42ae621 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Fri, 10 Jun 2022 16:51:20 +0800 Subject: [PATCH] feat: set account modified time --- internal/operations/account.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/operations/account.go b/internal/operations/account.go index c64d9ffa7c8..f49f3aea31c 100644 --- a/internal/operations/account.go +++ b/internal/operations/account.go @@ -11,6 +11,7 @@ import ( "sort" "strings" "sync" + "time" ) // Although the driver type is stored, @@ -29,6 +30,7 @@ func GetAccountByVirtualPath(virtualPath string) (driver.Driver, error) { // CreateAccount Save the account to database so account can get an id // then instantiate corresponding driver and save it in memory func CreateAccount(ctx context.Context, account model.Account) error { + account.Modified = time.Now() err := store.CreateAccount(&account) if err != nil { return errors.WithMessage(err, "failed create account in database") @@ -56,6 +58,7 @@ func UpdateAccount(ctx context.Context, account model.Account) error { if err != nil { return errors.WithMessage(err, "failed get old account") } + account.Modified = time.Now() err = store.UpdateAccount(&account) if err != nil { return errors.WithMessage(err, "failed update account in database")