fix race
ci-agent / build (push) Failing after 2m42s

This commit is contained in:
2026-04-04 18:10:05 +03:00
parent 958211198c
commit 398c688fed
@@ -81,6 +81,7 @@ func (self *Agent) AddJob(job models.JobForInsert) (int64, error) {
if err != nil {
return 0, err
}
self.jobs[jid] = newJob()
self.in <- &proto.Command{
Id: jid,
Command: job.Command,
@@ -155,7 +156,6 @@ func (self *Agent) recv() error {
func (self *Agent) send() error {
for job := range self.in {
self.jobs[job.Id] = newJob()
if err := self.bidi.Send(job); err != nil {
return err
}