mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
feat(lens): track active jobs before their first review
This commit is contained in:
parent
d16b0d7132
commit
b4ef33b7a1
2 changed files with 3 additions and 3 deletions
|
|
@ -222,8 +222,8 @@ describe("which job the live run shows", () => {
|
|||
expect(liveJob([job("new", "running", [review("a")]), job("old", "completed", [review("b")])])?.id).toBe("new");
|
||||
});
|
||||
|
||||
it("shows nothing for an active job with no reviews yet, even if an older job has some", () => {
|
||||
expect(liveJob([job("new", "queued", []), job("old", "completed", [review("b")])])).toBeUndefined();
|
||||
it("shows an active job before its first review so the wait is explained", () => {
|
||||
expect(liveJob([job("new", "queued", []), job("old", "completed", [review("b")])])?.id).toBe("new");
|
||||
});
|
||||
|
||||
it("keeps the latest finished job viewable only when it has reviews", () => {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ const REPLAY_ON_OPEN = 3;
|
|||
|
||||
export function liveJob(jobs: readonly Job[]): Job | undefined {
|
||||
const active = jobs.find((job) => job.status === "queued" || job.status === "running");
|
||||
if (active) return active.reviews.length ? active : undefined;
|
||||
if (active) return active;
|
||||
const latest = jobs[0];
|
||||
return latest?.reviews.length ? latest : undefined;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue