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
6a30bfa6
Commit
6a30bfa6
authored
Aug 24, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove archive.files col
parent
14ce01b4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
17 deletions
+16
-17
console-api/src/entities/Archive.entity.ts
console-api/src/entities/Archive.entity.ts
+2
-2
console-api/src/packager/packager.service.ts
console-api/src/packager/packager.service.ts
+1
-1
console-api/src/update/update.service.ts
console-api/src/update/update.service.ts
+13
-14
No files found.
console-api/src/entities/Archive.entity.ts
View file @
6a30bfa6
...
@@ -15,8 +15,8 @@ export class Archive extends TimeBase {
...
@@ -15,8 +15,8 @@ export class Archive extends TimeBase {
@
PrimaryGeneratedColumn
({
type
:
'
int8
'
})
@
PrimaryGeneratedColumn
({
type
:
'
int8
'
})
id
:
number
;
id
:
number
;
@
Column
(
'
varchar
'
,
{
length
:
256
,
array
:
true
})
//
@Column('varchar', { length: 256, array: true })
files
:
string
[];
//
files: string[];
@
OneToMany
(()
=>
ArchiveFile
,
(
file
)
=>
file
.
archive
,
{
cascade
:
true
})
@
OneToMany
(()
=>
ArchiveFile
,
(
file
)
=>
file
.
archive
,
{
cascade
:
true
})
containingFiles
:
ArchiveFile
[];
containingFiles
:
ArchiveFile
[];
...
...
console-api/src/packager/packager.service.ts
View file @
6a30bfa6
...
@@ -47,7 +47,7 @@ export class ArchiveTask {
...
@@ -47,7 +47,7 @@ export class ArchiveTask {
const
archive
=
new
Archive
();
const
archive
=
new
Archive
();
archive
.
path
=
this
.
path
;
archive
.
path
=
this
.
path
;
archive
.
role
=
this
.
role
;
archive
.
role
=
this
.
role
;
archive
.
files
=
this
.
exactFilePaths
;
//
archive.files = this.exactFilePaths;
archive
.
containingFiles
=
this
.
exactFilePaths
.
map
((
filePath
)
=>
ArchiveFile
.
fromPath
(
filePath
));
archive
.
containingFiles
=
this
.
exactFilePaths
.
map
((
filePath
)
=>
ArchiveFile
.
fromPath
(
filePath
));
return
archive
;
return
archive
;
}
}
...
...
console-api/src/update/update.service.ts
View file @
6a30bfa6
...
@@ -139,8 +139,8 @@ export class UpdateService extends ConsoleLogger {
...
@@ -139,8 +139,8 @@ export class UpdateService extends ConsoleLogger {
async
getPartPackageMetalink
(
id
:
string
,
depotDto
:
DepotDto
,
version
:
string
,
requestedFiles
:
string
[])
{
async
getPartPackageMetalink
(
id
:
string
,
depotDto
:
DepotDto
,
version
:
string
,
requestedFiles
:
string
[])
{
const
build
=
await
this
.
getBuild
(
id
,
depotDto
,
version
,
(
qb
)
=>
qb
.
select
(
'
build.id
'
));
const
build
=
await
this
.
getBuild
(
id
,
depotDto
,
version
,
(
qb
)
=>
qb
.
select
(
'
build.id
'
));
let
clock
=
moment
();
//
let clock = moment();
this
.
log
(
'
part 1
'
);
//
this.log('part 1');
const
tryExactArchiveQuery
=
this
.
db
const
tryExactArchiveQuery
=
this
.
db
.
getRepository
(
Archive
)
.
getRepository
(
Archive
)
.
createQueryBuilder
(
'
archive
'
)
.
createQueryBuilder
(
'
archive
'
)
...
@@ -172,7 +172,7 @@ export class UpdateService extends ConsoleLogger {
...
@@ -172,7 +172,7 @@ export class UpdateService extends ConsoleLogger {
archives
:
tryExactArchives
,
archives
:
tryExactArchives
,
};
};
}
}
this
.
log
(
`Time used:
${
moment
().
diff
(
clock
,
'
seconds
'
)}
s`
);
//
this.log(`Time used: ${moment().diff(clock, 'seconds')} s`);
/*clock = moment();
/*clock = moment();
this.log('part ex');
this.log('part ex');
const archiveIds: number[] = (
const archiveIds: number[] = (
...
@@ -186,8 +186,8 @@ export class UpdateService extends ConsoleLogger {
...
@@ -186,8 +186,8 @@ export class UpdateService extends ConsoleLogger {
.getRawMany()
.getRawMany()
).map((obj) => obj.archiveId);
).map((obj) => obj.archiveId);
this.log(`Time used: ${moment().diff(clock, 'seconds')} s`);*/
this.log(`Time used: ${moment().diff(clock, 'seconds')} s`);*/
clock
=
moment
();
//
clock = moment();
this
.
log
(
'
part 2
'
);
//
this.log('part 2');
const
allPartArchivesQuery
=
this
.
db
const
allPartArchivesQuery
=
this
.
db
.
getRepository
(
Archive
)
.
getRepository
(
Archive
)
.
createQueryBuilder
(
'
archive
'
)
.
createQueryBuilder
(
'
archive
'
)
...
@@ -198,19 +198,18 @@ export class UpdateService extends ConsoleLogger {
...
@@ -198,19 +198,18 @@ export class UpdateService extends ConsoleLogger {
//.andWhere('file.path = any(:requestedFiles)', { requestedFiles: requestedFiles });
//.andWhere('file.path = any(:requestedFiles)', { requestedFiles: requestedFiles });
allPartArchivesQuery
.
andWhere
(
allPartArchivesQuery
.
andWhere
(
`
exists
${
allPartArchivesQuery
`
archive.id in (
${
allPartArchivesQuery
.
subQuery
()
.
subQuery
()
.
select
(
'
file.path
'
)
.
select
(
'
distinct(file.archiveId)
'
)
.
from
(
ArchiveFile
,
'
file
'
)
.
from
(
ArchiveFile
,
'
file
'
)
.
where
(
'
file.archiveId = archive.id
'
)
.
where
(
'
file.path = any(:requestedFiles)
'
,
{
requestedFiles
:
requestedFiles
})
.
andWhere
(
'
file.path = any(:requestedFiles)
'
,
{
requestedFiles
:
requestedFiles
})
.
getQuery
()}
)`
.
getQuery
()}
`
);
);
const
allPartArchives
=
await
allPartArchivesQuery
.
getMany
();
const
allPartArchives
=
await
allPartArchivesQuery
.
getMany
();
this
.
log
(
`Time used:
${
moment
().
diff
(
clock
,
'
seconds
'
)}
s`
);
//
this.log(`Time used: ${moment().diff(clock, 'seconds')} s`);
clock
=
moment
();
//
clock = moment();
this
.
log
(
'
part 3
'
);
//
this.log('part 3');
const
fullArchive
=
await
this
.
db
const
fullArchive
=
await
this
.
db
.
getRepository
(
Archive
)
.
getRepository
(
Archive
)
.
createQueryBuilder
(
'
archive
'
)
.
createQueryBuilder
(
'
archive
'
)
...
@@ -224,7 +223,7 @@ export class UpdateService extends ConsoleLogger {
...
@@ -224,7 +223,7 @@ export class UpdateService extends ConsoleLogger {
if
(
fullArchive
&&
this
.
getCostOfArchives
([
fullArchive
])
<=
this
.
getCostOfArchives
(
allPartArchives
))
{
if
(
fullArchive
&&
this
.
getCostOfArchives
([
fullArchive
])
<=
this
.
getCostOfArchives
(
allPartArchives
))
{
archives
=
[
fullArchive
];
archives
=
[
fullArchive
];
}
}
this
.
log
(
`Time used:
${
moment
().
diff
(
clock
,
'
seconds
'
)}
s`
);
//
this.log(`Time used: ${moment().diff(clock, 'seconds')} s`);
return
{
return
{
cdnUrl
:
this
.
cdnUrl
,
cdnUrl
:
this
.
cdnUrl
,
archives
,
archives
,
...
...
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