1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-11-24 08:02:18 +02:00

purge log w/ timestamp

This commit is contained in:
Tony Li 2018-01-18 13:08:11 -05:00 committed by GitHub
parent 8771fb53af
commit e15e88584e
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()
buf := bytes.NewBufferString(fmt.Sprintf(deleteStr, proc.Name, user.Login, t.Format(time.RFC3339))
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"
}
]`