mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-01 13:18:41 +00:00
purge log w/ timestamp
This commit is contained in:
parent
8771fb53af
commit
e15e88584e
1 changed files with 3 additions and 2 deletions
|
@ -693,7 +693,8 @@ func DeleteBuildLogs(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, proc := range procs {
|
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)
|
lerr := store.FromContext(c).LogSave(proc, buf)
|
||||||
if lerr != nil {
|
if lerr != nil {
|
||||||
err = lerr
|
err = lerr
|
||||||
|
@ -711,6 +712,6 @@ var deleteStr = `[
|
||||||
{
|
{
|
||||||
"proc": %q,
|
"proc": %q,
|
||||||
"pos": 0,
|
"pos": 0,
|
||||||
"out": "logs purged by %s\n"
|
"out": "logs purged by %s on %s\n"
|
||||||
}
|
}
|
||||||
]`
|
]`
|
||||||
|
|
Loading…
Reference in a new issue