Skip to content

Commit

Permalink
Service installs: Avoid creating duplicate tasks on device registration
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
thgreasi committed Nov 28, 2024
1 parent 39fb0d9 commit ad0c14d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/features/ci-cd/hooks/service-installs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,13 @@ hooks.addPureHook('POST', 'resin', 'device', {
const app = request.values.belongs_to__application;
if (app != null) {
await createAppServiceInstalls(rootApi, app, [deviceId], tx);
if (ASYNC_TASKS_ENABLED && ASYNC_TASK_CREATE_SERVICE_INSTALLS_ENABLED) {
// When creating service installs via the async tasks, a single call to createServiceInstallsAsync()
// creates all service installs (target release, hostApp & SV release), so we don't need
// to run the extra code below to handle them separately, and doing so would create
// duplicate & unnecessary tasks.
return;
}
}

const release = request.values.is_pinned_on__release;
Expand Down

0 comments on commit ad0c14d

Please sign in to comment.