diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-08-09 15:40:10 -0700 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-08-09 15:40:10 -0700 |
commit | 9a1d5d2489d25778e26ab413cb9ee78d3fe2823a (patch) | |
tree | 4e31de40d92b96ba9fa8f45e5da442291303832e /cmd/serve.go | |
parent | 9820b8e1342017edfe4f6ced9cc3a7d811449c7b (diff) | |
download | gitea-9a1d5d2489d25778e26ab413cb9ee78d3fe2823a.tar.gz gitea-9a1d5d2489d25778e26ab413cb9ee78d3fe2823a.zip |
Finish new web hook pages
Diffstat (limited to 'cmd/serve.go')
-rw-r--r-- | cmd/serve.go | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/cmd/serve.go b/cmd/serve.go index 41dece6fa1..b1dffc92e7 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -11,10 +11,10 @@ import ( "path" "path/filepath" "strings" - - "github.com/codegangsta/cli" + "time" "github.com/Unknwon/com" + "github.com/codegangsta/cli" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/log" @@ -184,19 +184,29 @@ func runServ(k *cli.Context) { if isWrite { tasks, err := models.GetUpdateTasksByUuid(uuid) if err != nil { - log.GitLogger.Fatal(2, "Fail to get update task: %v", err) + log.GitLogger.Fatal(2, "GetUpdateTasksByUuid: %v", err) } for _, task := range tasks { err = models.Update(task.RefName, task.OldCommitId, task.NewCommitId, user.Name, repoUserName, repoName, user.Id) if err != nil { - log.GitLogger.Fatal(2, "Fail to update: %v", err) + log.GitLogger.Error(2, "Fail to update: %v", err) } } if err = models.DelUpdateTasksByUuid(uuid); err != nil { - log.GitLogger.Fatal(2, "Fail to del update task: %v", err) + log.GitLogger.Fatal(2, "DelUpdateTasksByUuid: %v", err) } } + + // Update key activity. + key, err := models.GetPublicKeyById(keyId) + if err != nil { + log.GitLogger.Fatal(2, "GetPublicKeyById: %v", err) + } + key.Updated = time.Now() + if err = models.UpdatePublicKey(key); err != nil { + log.GitLogger.Fatal(2, "UpdatePublicKey: %v", err) + } } |