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
d0c50744
Commit
d0c50744
authored
Aug 25, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chunk database save
parent
a783907a
Pipeline
#4990
passed with stages
in 3 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
console-api/src/app.service.ts
console-api/src/app.service.ts
+24
-3
console-api/src/entities/Archive.entity.ts
console-api/src/entities/Archive.entity.ts
+4
-0
No files found.
console-api/src/app.service.ts
View file @
d0c50744
...
...
@@ -190,7 +190,7 @@ export class AppService extends ConsoleLogger {
if
(
await
this
.
checkExistingBuild
(
depot
,
version
))
{
throw
new
BlankReturnMessageDto
(
404
,
'
Build exists
'
).
toException
();
}
cons
t
build
=
new
Build
();
le
t
build
=
new
Build
();
build
.
depot
=
depot
;
build
.
version
=
version
;
this
.
log
(
`Start packaging
${
app
.
id
}
${
version
}
for
${
JSON
.
stringify
(
depot
)}
.`
);
...
...
@@ -203,8 +203,29 @@ export class AppService extends ConsoleLogger {
const
result
=
await
this
.
packager
.
build
(
stream
,
app
.
packagePrefix
,
previousTracingBuildChecksums
);
this
.
log
(
`Saving package info of
${
app
.
id
}
${
version
}
for
${
JSON
.
stringify
(
depot
)}
`
);
build
.
checksum
=
result
.
checksum
;
build
.
archives
=
result
.
archives
;
await
this
.
db
.
getRepository
(
Build
).
save
(
build
);
// build.archives = result.archives;
await
this
.
db
.
transaction
(
async
(
edb
)
=>
{
this
.
log
(
`Saving build info.`
);
build
=
await
edb
.
getRepository
(
Build
).
save
(
build
);
let
archivePot
:
Archive
[]
=
[];
let
currentSize
=
0
;
for
(
const
archive
of
result
.
archives
)
{
archive
.
build
=
build
;
const
size
=
archive
.
paramSize
;
if
(
currentSize
>
0
&&
currentSize
+
size
>
60000
)
{
this
.
log
(
`Saving
${
archivePot
.
length
}
archive infos.`
);
await
edb
.
getRepository
(
Archive
).
save
(
archivePot
);
archivePot
=
[];
currentSize
=
0
;
}
archivePot
.
push
(
archive
);
currentSize
+=
size
;
}
if
(
archivePot
.
length
)
{
this
.
log
(
`Saving
${
archivePot
.
length
}
archive infos.`
);
await
edb
.
getRepository
(
Archive
).
save
(
archivePot
);
}
});
this
.
log
(
`Finished packaging
${
app
.
id
}
${
version
}
for
${
JSON
.
stringify
(
depot
)}
`
);
return
new
BlankReturnMessageDto
(
201
,
'
success
'
);
}
catch
(
e
)
{
...
...
console-api/src/entities/Archive.entity.ts
View file @
d0c50744
...
...
@@ -42,6 +42,10 @@ export class Archive extends TimeBase {
return
`
${
this
.
path
}
.tar.zst`
;
}
get
paramSize
()
{
return
5
+
(
this
.
containingFiles
?
this
.
containingFiles
.
length
:
0
);
}
toMetalinkView
()
{
return
{
name
:
this
.
archiveFullPath
,
...
...
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