Skip to content

Commit 8d4b842

Browse files
committed
Fix for the queue list pagination and upgrade status
1 parent f7c2aa1 commit 8d4b842

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

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

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,34 @@ export class QueueListPresenter extends BasePresenter {
2626
const totalQueues = await this._replica.taskQueue.count({
2727
where: {
2828
runtimeEnvironmentId: environment.id,
29+
version: "V2",
2930
},
3031
});
3132

3233
//check the engine is the correct version
3334
const engineVersion = await determineEngineVersion({ environment });
34-
3535
if (engineVersion === "V1") {
36-
return {
37-
success: false as const,
38-
code: "engine-version",
39-
totalQueues,
40-
};
36+
if (totalQueues === 0) {
37+
const oldQueue = await this._replica.taskQueue.findFirst({
38+
where: {
39+
runtimeEnvironmentId: environment.id,
40+
version: "V1",
41+
},
42+
});
43+
if (oldQueue) {
44+
return {
45+
success: false as const,
46+
code: "engine-version",
47+
totalQueues: 1,
48+
};
49+
} else {
50+
return {
51+
success: false as const,
52+
code: "engine-version",
53+
totalQueues,
54+
};
55+
}
56+
}
4157
}
4258

4359
return {

0 commit comments

Comments
 (0)