Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
cdn-node-checker
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
nanahira
cdn-node-checker
Commits
2675aeff
Commit
2675aeff
authored
Sep 25, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add maintaince
parent
479d0773
Pipeline
#16855
passed with stages
in 2 minutes and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
run.ts
run.ts
+14
-0
No files found.
run.ts
View file @
2675aeff
...
...
@@ -30,6 +30,7 @@ interface Config {
retryCount
:
number
;
interval
:
number
;
cocurrent
:
number
;
maintainance
?:
string
[];
}
interface
DomainRecordObject
{
...
...
@@ -350,6 +351,9 @@ class Checker {
return
ConnectResult
.
CDNBad
;
}
}
maintainance
:
Set
<
string
>
;
constructor
(
private
config
:
Config
)
{
this
.
queue
=
new
PQueue
({
concurrency
:
this
.
config
.
cocurrent
||
10
});
this
.
client
=
new
Aliyun
(
config
.
aliyun
);
...
...
@@ -367,6 +371,7 @@ class Checker {
this
.
checkMethods
.
set
(
'
icmp
'
,
(
record
:
Source
,
address
:
string
)
=>
{
return
this
.
checkIcmp
(
record
,
address
);
});
this
.
maintainance
=
new
Set
(
config
.
maintainance
||
[]);
}
private
message
(
msg
:
string
)
{
console
.
log
(
`
${
this
.
id
}
=>
${
msg
}
`
);
...
...
@@ -442,6 +447,15 @@ class Checker {
}
async
checkSource
(
source
:
Source
,
address
:
string
):
Promise
<
ConnectResult
>
{
if
(
this
.
maintainance
.
has
(
address
))
{
this
.
message
(
`Skip
${
this
.
getSourcePattern
(
source
,
address
,
)}
because it is in maintainance.`
,
);
return
ConnectResult
.
CDNBad
;
}
const
checkMethodFunction
=
this
.
checkMethods
.
get
(
source
.
protocol
);
assert
(
checkMethodFunction
,
...
...
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