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
3f76fec1
Commit
3f76fec1
authored
Feb 09, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add more logs
parent
0ce51300
Pipeline
#25385
passed with stages
in 2 minutes and 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
console-api/src/packager/packager.service.ts
console-api/src/packager/packager.service.ts
+13
-2
No files found.
console-api/src/packager/packager.service.ts
View file @
3f76fec1
...
...
@@ -227,7 +227,7 @@ export class PackagerService extends ConsoleLogger {
private
archiveQueue
=
new
PQueue
({
concurrency
:
parseInt
(
process
.
env
.
PACKAGE_COCURRENCY
)
||
os
.
cpus
().
length
});
private
async
archiveProcess
(
root
:
string
,
archiveTask
:
ArchiveTask
):
Promise
<
Archive
>
{
private
async
archiveProcess
(
root
:
string
,
archiveTask
:
ArchiveTask
,
retry
=
0
):
Promise
<
Archive
>
{
const
archive
=
archiveTask
.
archive
;
const
archiveName
=
archiveTask
.
archiveFullPath
;
const
existing
=
await
this
.
s3
.
fileExists
(
archiveName
);
...
...
@@ -263,7 +263,10 @@ export class PackagerService extends ConsoleLogger {
});
});
const
hashObject
=
createHash
(
'
sha256
'
);
let
length
=
0
;
child
.
stdout
.
on
(
'
data
'
,
(
chunk
)
=>
{
length
+=
chunk
.
length
;
this
.
log
(
`Received
${
length
}
bytes of archive
${
archiveName
}
.`
);
hashObject
.
update
(
chunk
);
});
...
...
@@ -272,6 +275,7 @@ export class PackagerService extends ConsoleLogger {
try
{
if
(
files
.
length
>
1000
)
{
this
.
warn
(
`Too many files in archive
${
archiveName
}
, using tmp file.`
);
// minio would skew the stream if it's too slow
// use a tmp file to put the stream
...
...
@@ -295,8 +299,15 @@ export class PackagerService extends ConsoleLogger {
archive
.
hash
=
hashObject
.
digest
(
'
hex
'
);
await
this
.
redis
.
set
(
`hash:
${
archive
.
path
}
`
,
archive
.
hash
,
'
EX
'
,
60
*
60
*
24
);
archive
.
size
=
object
.
Size
;
this
.
log
(
`Finished archiving
${
archiveName
}
with
${
length
}
bytes.`
);
return
archive
;
}
catch
(
e
)
{
this
.
error
(
`Failed to archive
${
archiveName
}
:
${
e
.
toString
()}
`
);
if
(
retry
<
3
)
{
this
.
warn
(
`Retrying archive
${
archiveName
}
.`
);
return
this
.
archiveProcess
(
root
,
archiveTask
,
retry
+
1
);
}
throw
e
;
}
finally
{
if
(
tmpFilename
)
{
await
fs
.
promises
.
rm
(
tmpFilename
);
...
...
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