mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-07-05 13:36:06 +00: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.
|
// Push pushes an task to the tail of this queue.
|
||||||
func (q *persistentQueue) Push(c context.Context, task *queue.Task) error {
|
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)
|
err := q.Queue.Push(c, task)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
q.store.TaskInsert(&Task{
|
q.store.TaskDelete(task.ID)
|
||||||
ID: task.ID,
|
|
||||||
Data: task.Data,
|
|
||||||
Labels: task.Labels,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue