diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-04-19 11:45:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-19 11:45:01 +0800 |
commit | 2eeae84cbd80544157a82c7f031489eaaceaa873 (patch) | |
tree | a275f41a3bb552df39724d4eca3dcdffe47dff8f /models/ssh_key.go | |
parent | f42ec6120e8a2830407027020b65391ebf8e7f59 (diff) | |
download | gitea-2eeae84cbd80544157a82c7f031489eaaceaa873.tar.gz gitea-2eeae84cbd80544157a82c7f031489eaaceaa873.zip |
Add internal routes for ssh hook comands (#1471)
* add internal routes for ssh hook comands
* fix lint
* add comment on why package named private not internal but the route name is internal
* add comment above package private why package named private not internal but the route name is internal
* remove exp time on internal access
* move routes from /internal to /api/internal
* add comment and defer on UpdatePublicKeyUpdated
Diffstat (limited to 'models/ssh_key.go')
-rw-r--r-- | models/ssh_key.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/models/ssh_key.go b/models/ssh_key.go index 75a0120c59..653889e488 100644 --- a/models/ssh_key.go +++ b/models/ssh_key.go @@ -502,8 +502,10 @@ func UpdatePublicKey(key *PublicKey) error { // UpdatePublicKeyUpdated updates public key use time. func UpdatePublicKeyUpdated(id int64) error { - cnt, err := x.ID(id).Cols("updated").Update(&PublicKey{ - Updated: time.Now(), + now := time.Now() + cnt, err := x.ID(id).Cols("updated_unix").Update(&PublicKey{ + Updated: now, + UpdatedUnix: now.Unix(), }) if err != nil { return err |