@@ -79,8 +79,6 @@ func Create(h Interface) error {
7979 // Create a cache with a default expiration time of 3 second, and which
8080 // purges expired items every minute
8181 spawnIDs := cache .New (10 * time .Second , 60 * time .Second )
82- // This is a local cache to avoid analysing a job twice at the same time
83- receivedIDs := cache .New (5 * time .Second , 60 * time .Second )
8482
8583 sdk .GoRoutine ("heartbeat" , func () {
8684 hearbeat (h , h .Configuration ().API .Token , h .Configuration ().API .MaxHeartbeatFailures )
@@ -106,7 +104,6 @@ func Create(h Interface) error {
106104 // read the result channel in another goroutine to let the main goroutine start new workers
107105 sdk .GoRoutine ("checkStarterResult" , func () {
108106 for startWorkerRes := range workerStartResultChan {
109- receivedIDs .Delete (string (startWorkerRes .request .id ))
110107 if startWorkerRes .err != nil {
111108 errs <- startWorkerRes .err
112109 }
@@ -209,13 +206,6 @@ func Create(h Interface) error {
209206 continue
210207 }
211208
212- // Check if the jobs has been received less than 10s ago
213- if _ , exist := receivedIDs .Get (string (j .ID )); exist {
214- log .Debug ("job %d is alrealy being analyzed" , j .ID )
215- continue
216- }
217- receivedIDs .SetDefault (string (j .ID ), j .ID )
218-
219209 //Check if the jobs is concerned by a pending worker creation
220210 if _ , exist := spawnIDs .Get (string (j .ID )); exist {
221211 log .Debug ("job %d already spawned in previous routine" , j .ID )
@@ -231,7 +221,6 @@ func Create(h Interface) error {
231221 //Check gracetime
232222 if j .QueuedSeconds < int64 (h .Configuration ().Provision .GraceTimeQueued ) {
233223 log .Debug ("job %d is too fresh, queued since %d seconds, let existing waiting worker check it" , j .ID )
234- receivedIDs .Delete (string (j .ID ))
235224 continue
236225 }
237226
0 commit comments