screwdriver-api 4.1.182 → 4.1.183

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-api",
3
- "version": "4.1.182",
3
+ "version": "4.1.183",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -529,11 +529,13 @@ async function handleNewBuild({ done, hasFailure, newBuild, jobName, pipelineId
529
529
  return null;
530
530
  }
531
531
 
532
- // If all join builds finished successfully, start new build
533
- newBuild.status = 'QUEUED';
534
- const queuedBuild = await newBuild.update();
532
+ // If all join builds finished successfully and it's clear that a new build has not been started before, start new build
533
+ if ([ 'CREATED', null, undefined ].includes(newBuild.status)) {
534
+ newBuild.status = 'QUEUED';
535
+ const queuedBuild = await newBuild.update();
535
536
 
536
- return queuedBuild.start();
537
+ return queuedBuild.start();
538
+ }
537
539
  }
538
540
 
539
541
  return null;