Ensure not marking successful releases as canceled

Resolves: #1178
Change-type: patch
Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
This commit is contained in:
Thodoris Greasidis 2019-04-22 20:09:00 +03:00
parent e9e15dbbe3
commit 1ee51ca9a7

View File

@ -204,6 +204,11 @@ async function cancelBuildIfNecessary(build: RemoteBuild): Promise<void> {
await build.sdk.pine.patch({ await build.sdk.pine.patch({
resource: 'release', resource: 'release',
id: build.releaseId, id: build.releaseId,
options: {
$filter: {
status: { $ne: 'success' },
},
},
body: { body: {
status: 'cancelled', status: 'cancelled',
end_timestamp: Date.now(), end_timestamp: Date.now(),