Skip to content

Commit

Permalink
only find prebuild events that are not in an inaccessible state (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugodutka committed May 24, 2023
1 parent 00794b5 commit 10a8fc1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/agent/activities/get-or-create-prebuild-events.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { PrebuildEvent } from "@prisma/client";
import { PrebuildEventStatus } from "@prisma/client";

import type { CreateActivity } from "./types";

Expand All @@ -25,6 +26,14 @@ export const getOrCreatePrebuildEvents: CreateActivity<GetOrCreatePrebuildEvents
where: {
projectId: args.projectId,
gitObjectId: { in: gitObjectIds },
status: {
notIn: [
PrebuildEventStatus.PREBUILD_EVENT_STATUS_ARCHIVED,
PrebuildEventStatus.PREBUILD_EVENT_STATUS_PENDING_ARCHIVE,
PrebuildEventStatus.PREBUILD_EVENT_STATUS_CANCELLED,
PrebuildEventStatus.PREBUILD_EVENT_STATUS_ERROR,
],
},
},
});
const foundEventsByGitObjectId = new Map(found.map((event) => [event.gitObjectId, event]));
Expand Down

0 comments on commit 10a8fc1

Please sign in to comment.