mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-23 17:53:23 +02:00
fix issue #2022
This commit is contained in:
parent
9c69e2a5e1
commit
797bb4970f
@ -42,13 +42,14 @@ type persistentQueue struct {
|
||||
|
||||
// Push pushes an task to the tail of this queue.
|
||||
func (q *persistentQueue) Push(c context.Context, task *queue.Task) error {
|
||||
q.store.TaskInsert(&Task{
|
||||
ID: task.ID,
|
||||
Data: task.Data,
|
||||
Labels: task.Labels,
|
||||
})
|
||||
err := q.Queue.Push(c, task)
|
||||
if err == nil {
|
||||
q.store.TaskInsert(&Task{
|
||||
ID: task.ID,
|
||||
Data: task.Data,
|
||||
Labels: task.Labels,
|
||||
})
|
||||
if err != nil {
|
||||
q.store.TaskDelete(task.ID)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user