File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed
apps/webapp/app/presenters/v3 Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments