summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-04-07 17:40:38 -0700
committerGitHub <noreply@github.com>2017-04-07 17:40:38 -0700
commit5c0bee9b20f50a26c7ac3fa90d1db2b8329d358b (patch)
tree365da2ff66c28f5f5fb179fa9387b5257c7a7ac2 /cmd
parentd9db1882745baf44e16375eb1dc4733bf2989848 (diff)
downloadgitea-5c0bee9b20f50a26c7ac3fa90d1db2b8329d358b.tar.gz
gitea-5c0bee9b20f50a26c7ac3fa90d1db2b8329d358b.zip
refactor update ssh key use time (#1466)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/serv.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/cmd/serv.go b/cmd/serv.go
index dc8952abe9..e3aeb41c56 100644
--- a/cmd/serv.go
+++ b/cmd/serv.go
@@ -316,13 +316,7 @@ func runServ(c *cli.Context) error {
// Update user key activity.
if keyID > 0 {
- key, err := models.GetPublicKeyByID(keyID)
- if err != nil {
- fail("Internal error", "GetPublicKeyById: %v", err)
- }
-
- key.Updated = time.Now()
- if err = models.UpdatePublicKey(key); err != nil {
+ if err = models.UpdatePublicKeyUpdated(keyID); err != nil {
fail("Internal error", "UpdatePublicKey: %v", err)
}
}