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
621974e9
Commit
621974e9
authored
May 05, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add limits of no gather exts
parent
5102aaae
Pipeline
#12479
passed with stages
in 3 minutes and 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
console-api/src/packager/packager.service.ts
console-api/src/packager/packager.service.ts
+7
-2
No files found.
console-api/src/packager/packager.service.ts
View file @
621974e9
...
...
@@ -63,6 +63,7 @@ export class ArchiveTask {
export
class
PackagerService
extends
ConsoleLogger
{
bucket_max
=
10
*
1024
**
2
;
bucket_enter
=
1
*
1024
**
2
;
noGatherExts
=
new
Set
<
string
>
();
packagerWorkingDirectory
:
string
;
private
uploadLock
=
new
Set
<
string
>
();
...
...
@@ -77,6 +78,10 @@ export class PackagerService extends ConsoleLogger {
this
.
bucket_max
=
(
parseInt
(
config
.
get
(
'
PACKAGE_BUCKET_MAX
'
))
||
10
)
*
1024
**
2
;
this
.
bucket_enter
=
(
parseInt
(
config
.
get
(
'
PACKAGE_BUCKET_ENTER
'
))
||
1
)
*
1024
**
2
;
this
.
packagerWorkingDirectory
=
config
.
get
(
'
PACKAGE_WORKING_DIRECTORY
'
)
||
os
.
tmpdir
();
const
noGatherExts
=
config
.
get
(
'
PACKAGE_NO_GATHER_EXTS
'
);
if
(
noGatherExts
)
{
this
.
noGatherExts
=
new
Set
(
noGatherExts
.
split
(
'
,
'
));
}
}
private
async
waitForLock
(
key
:
string
)
{
...
...
@@ -145,8 +150,8 @@ export class PackagerService extends ConsoleLogger {
// 散包
const
buckets
:
Record
<
string
,
[
FileWithHash
[],
number
]
>
=
{};
for
(
const
file
of
filesWithHash
)
{
if
(
file
.
file
.
stats
.
size
<
this
.
bucket_enter
)
{
const
extname
=
path
.
extname
(
file
.
file
.
basename
);
const
extname
=
path
.
extname
(
file
.
file
.
basename
);
if
(
file
.
file
.
stats
.
size
<
this
.
bucket_enter
&&
!
this
.
noGatherExts
.
has
(
extname
))
{
buckets
[
extname
]
??
=
[[],
0
];
const
bucket
=
buckets
[
extname
];
if
(
bucket
[
1
]
+
file
.
file
.
stats
.
size
>=
this
.
bucket_max
)
{
...
...
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