Skip to content

Commit

Permalink
Merge pull request #60 from daichitakahashi/listLostDispatches
Browse files Browse the repository at this point in the history
List lost dispatches
  • Loading branch information
daichitakahashi authored Dec 2, 2024
2 parents 1045a6f + ecf8be6 commit 3e2f9b0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
6 changes: 6 additions & 0 deletions cf-eventhub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# cf-eventhub

## 0.0.14

### Patch Changes

- fb0d41a: Fix PgRepository.listDispatches to list lost dispatches

## 0.0.13

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion cf-eventhub/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cf-eventhub",
"type": "module",
"version": "0.0.13",
"version": "0.0.14",
"keywords": [
"cloudflare"
],
Expand Down
11 changes: 11 additions & 0 deletions cf-eventhub/src/postgres/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ export class PgRepository implements Repository {
db
.select({
id: d.id,
result: schema.dispatchResults.result,
resultedAt: schema.dispatchResults.resultedAt,
})
.from(d)
.leftJoin(
Expand Down Expand Up @@ -410,6 +412,8 @@ export class PgRepository implements Repository {
createdAt: d.createdAt,
},
executions: executions.data,
result: targetDispatches.result,
resultedAt: targetDispatches.resultedAt,
})
.from(d)
.innerJoin(targetDispatches, eq(d.id, targetDispatches.id))
Expand Down Expand Up @@ -440,6 +444,13 @@ export class PgRepository implements Repository {
}
}
}
if (
row.result === "lost" &&
row.resultedAt &&
dispatch.status === "ongoing"
) {
dispatch = makeDispatchLost(dispatch, row.resultedAt);
}
return dispatch;
});
const last = hasNextPage ? list[list.length - 1] : undefined;
Expand Down
7 changes: 7 additions & 0 deletions iac/pulumi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @cf-eventhub/pulumi

## 0.0.11

### Patch Changes

- Updated dependencies [fb0d41a]
- [email protected]

## 0.0.10

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions iac/pulumi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@cf-eventhub/pulumi",
"main": "src/index.ts",
"type": "commonjs",
"version": "0.0.10",
"version": "0.0.11",
"keywords": [
"pulumi",
"cloudflare"
Expand All @@ -17,7 +17,7 @@
"dependencies": {
"@pulumi/cloudflare": "^5.40.0",
"@pulumi/pulumi": "^3.113.0",
"cf-eventhub": "^0.0.13"
"cf-eventhub": "^0.0.14"
},
"tsup": {
"entry": [
Expand Down
2 changes: 1 addition & 1 deletion web-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"typed-htmx": "^0.3.1",
"typescript": "^5.6.2",
"wrangler": "^3.83.0",
"cf-eventhub": "^0.0.13"
"cf-eventhub": "^0.0.14"
},
"tsup": {
"entry": [
Expand Down

0 comments on commit 3e2f9b0

Please sign in to comment.