Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
console
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
console
Commits
c7ee525a
Commit
c7ee525a
authored
Aug 04, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ignore version field entirely
parent
6e3b109c
Pipeline
#15348
canceled with stages
in 2 minutes and 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
28 deletions
+30
-28
console-api/src/update/update.service.ts
console-api/src/update/update.service.ts
+30
-28
No files found.
console-api/src/update/update.service.ts
View file @
c7ee525a
...
...
@@ -30,6 +30,7 @@ export class UpdateService extends ConsoleLogger {
(
a
)
=>
a
.
displayData
);
const
appVersionCacheMap
=
new
Map
<
string
,
string
>
();
const
foundApps
=
new
Set
<
string
>
();
for
(
const
_platform
of
Object
.
values
(
AppsJson
.
Platform
))
{
const
platform
=
_platform
as
AppsJson
.
Platform
;
if
(
platform
===
'
generic
'
)
{
...
...
@@ -41,40 +42,41 @@ export class UpdateService extends ConsoleLogger {
depotDto.platform = platform;*/
// this.log(platform);
for
(
const
app
of
data
)
{
if
(
app
.
version
?.[
platform
])
{
// this.log(`Try fetching latest version of ${app.id} ${platform}`);
const
tryCache
=
appVersionCacheMap
.
get
(
app
.
id
);
if
(
tryCache
)
{
app
.
version
[
platform
]
=
tryCache
;
}
app
.
version
??
=
{};
const
tryCache
=
appVersionCacheMap
.
get
(
app
.
id
);
if
(
tryCache
)
{
app
.
version
[
platform
]
=
tryCache
;
}
const
latestBuild
=
await
this
.
db
.
getRepository
(
Build
)
.
createQueryBuilder
(
'
build
'
)
.
select
([
'
build.version
'
,
'
build.id
'
,
'
depot.platform
'
])
.
innerJoin
(
'
build.depot
'
,
'
depot
'
)
.
where
(
'
depot.appId = :appId
'
,
{
appId
:
app
.
id
})
.
andWhere
(
new
Brackets
((
qb
)
=>
qb
.
where
(
'
depot.platform = :genericPlatform
'
,
{
genericPlatform
:
Platform
.
generic
})
.
orWhere
(
'
depot.platform = :platform
'
,
{
platform
})
)
const
latestBuild
=
await
this
.
db
.
getRepository
(
Build
)
.
createQueryBuilder
(
'
build
'
)
.
select
([
'
build.version
'
,
'
build.id
'
,
'
depot.platform
'
])
.
innerJoin
(
'
build.depot
'
,
'
depot
'
)
.
where
(
'
depot.appId = :appId
'
,
{
appId
:
app
.
id
})
.
andWhere
(
new
Brackets
((
qb
)
=>
qb
.
where
(
'
depot.platform = :genericPlatform
'
,
{
genericPlatform
:
Platform
.
generic
})
.
orWhere
(
'
depot.platform = :platform
'
,
{
platform
})
)
.
orderBy
(
'
build.id
'
,
'
DESC
'
)
.
take
(
1
)
.
getOne
();
if
(
latestBuild
)
{
const
latestVersion
=
latestBuild
.
version
;
if
(
latestBuild
.
depot
.
platform
===
'
generic
'
)
{
appVersionCacheMap
.
set
(
app
.
id
,
latestVersion
);
}
app
.
version
[
platform
]
=
latestVersion
;
)
.
orderBy
(
'
build.id
'
,
'
DESC
'
)
.
take
(
1
)
.
getOne
();
if
(
latestBuild
)
{
if
(
!
foundApps
.
has
(
app
.
id
))
{
foundApps
.
add
(
app
.
id
);
}
const
latestVersion
=
latestBuild
.
version
;
if
(
latestBuild
.
depot
.
platform
===
'
generic
'
)
{
appVersionCacheMap
.
set
(
app
.
id
,
latestVersion
);
}
app
.
version
[
platform
]
=
latestVersion
;
}
}
}
return
data
;
return
data
.
filter
((
app
)
=>
foundApps
.
has
(
app
.
id
))
;
}
private
async
getBuild
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment