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
This commit is contained in:
parent
f42ec6120e
commit
2eeae84cbd
7 changed files with 161 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue