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
0caef458
Commit
0caef458
authored
Sep 26, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build exists => 201
parent
ce55d460
Pipeline
#23568
failed with stages
in 2 minutes and 20 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
console-api/src/app.service.ts
console-api/src/app.service.ts
+1
-1
console-api/src/lock/lock.service.ts
console-api/src/lock/lock.service.ts
+9
-4
console-api/src/mirror/mirror.service.ts
console-api/src/mirror/mirror.service.ts
+1
-1
No files found.
console-api/src/app.service.ts
View file @
0caef458
...
@@ -196,7 +196,7 @@ export class AppService extends ConsoleLogger {
...
@@ -196,7 +196,7 @@ export class AppService extends ConsoleLogger {
}
}
const
depot
=
await
this
.
getOrCreateDepot
(
app
,
depotDto
);
const
depot
=
await
this
.
getOrCreateDepot
(
app
,
depotDto
);
if
(
await
this
.
checkExistingBuild
(
depot
,
version
))
{
if
(
await
this
.
checkExistingBuild
(
depot
,
version
))
{
throw
new
BlankReturnMessageDto
(
404
,
'
Build exists
'
).
toException
();
throw
new
BlankReturnMessageDto
(
201
,
'
Build exists
'
).
toException
();
}
}
let
build
=
new
Build
();
let
build
=
new
Build
();
build
.
depot
=
depot
;
build
.
depot
=
depot
;
...
...
console-api/src/lock/lock.service.ts
View file @
0caef458
import
{
InjectRedis
,
Redis
}
from
'
@nestjs-modules/ioredis
'
;
import
{
Injectable
}
from
'
@nestjs/common
'
;
import
{
Injectable
}
from
'
@nestjs/common
'
;
import
Redlock
from
'
@nanahira/redlock
'
;
import
Redlock
from
'
@nanahira/redlock
'
;
import
{
ConfigService
}
from
'
@nestjs/config
'
;
import
Redis
from
'
ioredis
'
;
@
Injectable
()
@
Injectable
()
export
class
LockService
extends
Redlock
{
export
class
LockService
{
constructor
(@
InjectRedis
()
private
readonly
redis
:
Redis
)
{
constructor
(
private
config
:
ConfigService
)
{
}
super
([
redis
]);
getLockInstance
()
{
const
url
=
this
.
config
.
get
<
string
>
(
'
REDIS_URL
'
);
const
redis
=
new
Redis
(
url
);
return
new
Redlock
([
redis
]);
}
}
}
}
console-api/src/mirror/mirror.service.ts
View file @
0caef458
...
@@ -185,7 +185,7 @@ export class MirrorService extends ConsoleLogger implements OnApplicationBootstr
...
@@ -185,7 +185,7 @@ export class MirrorService extends ConsoleLogger implements OnApplicationBootstr
if
(
!
middleware
.
singleton
)
{
if
(
!
middleware
.
singleton
)
{
return
this
.
uploadWithMiddlewareProcess
(
uploadInfo
,
middleware
);
return
this
.
uploadWithMiddlewareProcess
(
uploadInfo
,
middleware
);
}
}
return
this
.
redlock
.
using
([
`mirror:
${
middleware
.
identifier
}
`
],
5000
,
()
=>
this
.
uploadWithMiddlewareProcess
(
uploadInfo
,
middleware
));
return
this
.
redlock
.
getLockInstance
().
using
([
`mirror:
${
middleware
.
identifier
}
`
],
5000
,
()
=>
this
.
uploadWithMiddlewareProcess
(
uploadInfo
,
middleware
));
}
}
async
uploadWithRandomMiddleware
(
uploadInfo
:
UploadInfo
,
middlewares
=
Array
.
from
(
this
.
middlewares
.
values
()))
{
async
uploadWithRandomMiddleware
(
uploadInfo
:
UploadInfo
,
middlewares
=
Array
.
from
(
this
.
middlewares
.
values
()))
{
...
...
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