Notify Gitea about restarted tasks

This commit is contained in:
Přemysl Eric Janouch 2024-04-10 15:03:26 +02:00
parent d4405a0cde
commit 38669ce2ed
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 3 additions and 2 deletions

View File

@ -373,8 +373,8 @@ func rpcRestart(w io.Writer, ids []int64) {
// The executor bumps to "running" after inserting into gRunning, // The executor bumps to "running" after inserting into gRunning,
// so we should not need to exclude that state here. // so we should not need to exclude that state here.
result, err := gDB.ExecContext(context.Background(), result, err := gDB.ExecContext(context.Background(), `UPDATE task
`UPDATE task SET state = ?, detail = '' WHERE id = ?`, SET state = ?, detail = '', notified = 0 WHERE id = ?`,
taskStateNew, id) taskStateNew, id)
if err != nil { if err != nil {
fmt.Fprintf(w, "%d: %s\n", id, err) fmt.Fprintf(w, "%d: %s\n", id, err)
@ -382,6 +382,7 @@ func rpcRestart(w io.Writer, ids []int64) {
fmt.Fprintf(w, "%d: no such task\n", id) fmt.Fprintf(w, "%d: no such task\n", id)
} }
} }
notifierAwaken()
executorAwaken() executorAwaken()
} }