Merge pull request #2309 from tonglil/patch-1

Log timestamp when puring log
This commit is contained in:
Brad Rydzewski 2018-01-18 10:45:51 -08:00 committed by GitHub
commit 75150d4a42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -693,7 +693,8 @@ func DeleteBuildLogs(c *gin.Context) {
}
for _, proc := range procs {
buf := bytes.NewBufferString(fmt.Sprintf(deleteStr, proc.Name, user.Login))
t := time.Now().UTC()
buf := bytes.NewBufferString(fmt.Sprintf(deleteStr, proc.Name, user.Login, t.Format(time.UnixDate)))
lerr := store.FromContext(c).LogSave(proc, buf)
if lerr != nil {
err = lerr
@ -711,6 +712,6 @@ var deleteStr = `[
{
"proc": %q,
"pos": 0,
"out": "logs purged by %s\n"
"out": "logs purged by %s on %s\n"
}
]`