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
6c89a95b
Commit
6c89a95b
authored
Oct 26, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix loop cycle
parent
3bcb5253
Pipeline
#17480
passed with stages
in 2 minutes and 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
console-api/src/mirror/mirror.service.ts
console-api/src/mirror/mirror.service.ts
+4
-4
No files found.
console-api/src/mirror/mirror.service.ts
View file @
6c89a95b
import
{
ConsoleLogger
,
Injectable
}
from
'
@nestjs/common
'
;
import
{
ConsoleLogger
,
Injectable
,
OnApplicationBootstrap
}
from
'
@nestjs/common
'
;
import
{
InjectConnection
}
from
'
@nestjs/typeorm
'
;
import
{
Connection
}
from
'
typeorm
'
;
import
{
ConfigService
}
from
'
@nestjs/config
'
;
...
...
@@ -36,7 +36,7 @@ export interface UploadResult {
}
@
Injectable
()
export
class
MirrorService
extends
ConsoleLogger
{
export
class
MirrorService
extends
ConsoleLogger
implements
OnApplicationBootstrap
{
private
middlewares
=
new
Map
<
string
,
Middleware
>
();
private
maximumMirroredSize
=
0x7fffffff
;
private
mirrorConcurrent
=
this
.
config
.
get
(
'
MIRROR_CONCURRENT
'
)
||
100
;
...
...
@@ -49,10 +49,9 @@ export class MirrorService extends ConsoleLogger {
private
redlock
:
LockService
)
{
super
(
'
mirror
'
);
this
.
init
().
then
();
}
private
async
init
()
{
async
onApplicationBootstrap
()
{
const
middlewareUrlStrings
=
this
.
config
.
get
<
string
>
(
'
MIRROR_MIDDLEWARES
'
);
if
(
!
middlewareUrlStrings
)
{
return
;
...
...
@@ -153,6 +152,7 @@ export class MirrorService extends ConsoleLogger {
}
this
.
log
(
`Saving
${
uploadResults
.
length
}
mirror records.`
);
await
this
.
db
.
getRepository
(
ArchiveMirror
).
save
(
uploadResults
);
return
true
;
}
private
async
uploadWithMiddlewareProcess
(
uploadInfo
:
UploadInfo
,
middleware
:
Middleware
):
Promise
<
UploadResult
>
{
...
...
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