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
894f815f
Commit
894f815f
authored
Sep 01, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
limit http queue
parent
98dc2566
Pipeline
#16316
passed with stages
in 1 minute and 19 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
1 deletion
+72
-1
package-lock.json
package-lock.json
+67
-0
package.json
package.json
+1
-0
run.ts
run.ts
+4
-1
No files found.
package-lock.json
View file @
894f815f
...
...
@@ -17,6 +17,7 @@
"delay"
:
"^5.0.0"
,
"icmp"
:
"^2.0.1"
,
"lodash"
:
"^4.17.21"
,
"p-queue"
:
"6.6.2"
,
"q"
:
"^1.5.1"
,
"yaml"
:
"^1.10.0"
},
...
...
@@ -1055,6 +1056,11 @@
"node"
:
">=0.10.0"
}
},
"node_modules/eventemitter3"
:
{
"version"
:
"4.0.7"
,
"resolved"
:
"https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz"
,
"integrity"
:
"sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
},
"node_modules/fast-deep-equal"
:
{
"version"
:
"3.1.3"
,
"resolved"
:
"https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz"
,
...
...
@@ -1570,6 +1576,40 @@
"node"
:
">= 0.8.0"
}
},
"node_modules/p-finally"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz"
,
"integrity"
:
"sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow=="
,
"engines"
:
{
"node"
:
">=4"
}
},
"node_modules/p-queue"
:
{
"version"
:
"6.6.2"
,
"resolved"
:
"https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz"
,
"integrity"
:
"sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ=="
,
"dependencies"
:
{
"eventemitter3"
:
"^4.0.4"
,
"p-timeout"
:
"^3.2.0"
},
"engines"
:
{
"node"
:
">=8"
},
"funding"
:
{
"url"
:
"https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-timeout"
:
{
"version"
:
"3.2.0"
,
"resolved"
:
"https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz"
,
"integrity"
:
"sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg=="
,
"dependencies"
:
{
"p-finally"
:
"^1.0.0"
},
"engines"
:
{
"node"
:
">=8"
}
},
"node_modules/parent-module"
:
{
"version"
:
"1.0.1"
,
"resolved"
:
"https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz"
,
...
...
@@ -2838,6 +2878,11 @@
"integrity"
:
"sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="
,
"dev"
:
true
},
"eventemitter3"
:
{
"version"
:
"4.0.7"
,
"resolved"
:
"https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz"
,
"integrity"
:
"sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
},
"fast-deep-equal"
:
{
"version"
:
"3.1.3"
,
"resolved"
:
"https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz"
,
...
...
@@ -3268,6 +3313,28 @@
"word-wrap"
:
"^1.2.3"
}
},
"p-finally"
:
{
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz"
,
"integrity"
:
"sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow=="
},
"p-queue"
:
{
"version"
:
"6.6.2"
,
"resolved"
:
"https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz"
,
"integrity"
:
"sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ=="
,
"requires"
:
{
"eventemitter3"
:
"^4.0.4"
,
"p-timeout"
:
"^3.2.0"
}
},
"p-timeout"
:
{
"version"
:
"3.2.0"
,
"resolved"
:
"https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz"
,
"integrity"
:
"sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg=="
,
"requires"
:
{
"p-finally"
:
"^1.0.0"
}
},
"parent-module"
:
{
"version"
:
"1.0.1"
,
"resolved"
:
"https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz"
,
...
...
package.json
View file @
894f815f
...
...
@@ -22,6 +22,7 @@
"
delay
"
:
"
^5.0.0
"
,
"
icmp
"
:
"
^2.0.1
"
,
"
lodash
"
:
"
^4.17.21
"
,
"
p-queue
"
:
"
6.6.2
"
,
"
q
"
:
"
^1.5.1
"
,
"
yaml
"
:
"
^1.10.0
"
},
...
...
run.ts
View file @
894f815f
...
...
@@ -7,6 +7,7 @@ import net from 'net';
import
{
assert
}
from
'
console
'
;
import
{
ping
}
from
'
icmp
'
;
import
delay
from
'
delay
'
;
import
PQueue
from
'
p-queue
'
;
interface
Source
{
protocol
:
string
;
...
...
@@ -202,6 +203,8 @@ class Checker {
}
}
private
queue
=
new
PQueue
({
concurrency
:
100
});
private
async
tryConnectHttp
(
protocol
:
string
,
address
:
string
,
...
...
@@ -210,7 +213,7 @@ class Checker {
)
{
const
url
=
`
${
protocol
}
://
${
address
}
:
${
port
}
`
;
// const urlKey = `${url}-${hostHeader}`;
return
this
.
connectHttpProcess
(
url
,
hostHeader
);
return
this
.
queue
.
add
(()
=>
this
.
connectHttpProcess
(
url
,
hostHeader
)
);
}
async
checkHttpOrHttps
(
record
:
Source
,
address
:
string
)
{
let
good
=
false
;
...
...
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