Skip to content

Commit 25e6267

Browse files
committed
Make sure runs.list still works
1 parent b080384 commit 25e6267

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export class ApiRunListPresenter extends BasePresenter {
211211

212212
const results = await presenter.call(environmentId, options);
213213

214-
logger.debug("RunListPresenter results", { results });
214+
logger.debug("RunListPresenter results", { runs: results.runs.length });
215215

216216
const data: ListRunResponseItem[] = await Promise.all(
217217
results.runs.map(async (run) => {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { logger, runs, task } from "@trigger.dev/sdk";
2+
3+
export const sdkMethods = task({
4+
id: "sdk-methods",
5+
run: async (payload: any, { ctx }) => {
6+
for await (const run of runs.list({
7+
status: ["COMPLETED"],
8+
from: new Date(Date.now() - 1000 * 60 * 60), // 1 hour ago
9+
to: new Date(), // now
10+
})) {
11+
logger.info("completed run", { run });
12+
}
13+
14+
for await (const run of runs.list({
15+
status: ["FAILED"],
16+
from: new Date(Date.now() - 1000 * 60 * 60), // 1 hour ago
17+
to: new Date(), // now
18+
limit: 50,
19+
})) {
20+
logger.info("failed run", { run });
21+
}
22+
23+
return runs;
24+
},
25+
});

0 commit comments

Comments
 (0)