Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
browser-backend
Commits
3d35f69e
Commit
3d35f69e
authored
May 19, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ip健康检查过滤已过期ip
parent
f423ad8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
BrowserTask.java
...va/com/edgec/browserbackend/browser/task/BrowserTask.java
+8
-3
No files found.
src/main/java/com/edgec/browserbackend/browser/task/BrowserTask.java
View file @
3d35f69e
...
...
@@ -25,6 +25,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.aggregation.ArrayOperators
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
...
...
@@ -238,7 +239,11 @@ public class BrowserTask {
if
(
ipResourceRepository
.
healthLock
(
ipResource
))
{
try
{
QueryIpUrlList
queryIpUrlList
=
queryIpUrlListRepository
.
findAll
().
get
(
0
);
if
(
ipResource
.
isSpecialLine
())
{
if
(
ipResource
.
getValidTime
()
<=
Instant
.
now
().
toEpochMilli
()
&&
ipResource
.
getStatus
()
!=
3
&&
ipResource
.
getStatus
()
!=
6
)
{
ipResource
.
setStatus
(
1
);
ipResourceRepository
.
save
(
ipResource
);
}
else
if
(
ipResource
.
isSpecialLine
())
{
Trans
trans
=
new
Trans
(
ipResource
.
getProxyUsername
(),
ipResource
.
getProxyPassword
());
String
sp_result
=
trans
.
get
(
queryIpUrlList
.
getUrl
());
int
failTime
=
0
;
...
...
@@ -296,7 +301,7 @@ public class BrowserTask {
IpCountRecord
ipCountRecord
=
new
IpCountRecord
();
ipCountRecord
.
setUsername
(
x
.
getName
());
ipCountRecord
.
setTimestamp
(
Instant
.
now
().
toEpochMilli
());
long
ipcount_using
=
ipResourceRepository
.
countAllByOwnerAndIsDeleted
(
x
.
getName
(),
false
);
long
ipcount_using
=
ipResourceRepository
.
countAllByOwnerAndIsDeleted
AndValidTimeGreaterThan
(
x
.
getName
(),
false
,
Instant
.
now
().
toEpochMilli
()
);
long
ipcount_all
=
ipResourceRepository
.
countAllByOwner
(
x
.
getName
());
ipCountRecord
.
setIp_all
(
ipcount_all
);
ipCountRecord
.
setIp_using
(
ipcount_using
);
...
...
@@ -305,7 +310,7 @@ public class BrowserTask {
IpCountRecord
ipCountRecord
=
new
IpCountRecord
();
ipCountRecord
.
setUsername
(
"all"
);
ipCountRecord
.
setTimestamp
(
Instant
.
now
().
toEpochMilli
());
long
ipcount_using
=
ipResourceRepository
.
countAllByIsDeleted
(
false
);
long
ipcount_using
=
ipResourceRepository
.
countAllByIsDeleted
AndValidTimeGreaterThan
(
false
,
Instant
.
now
().
toEpochMilli
()
);
long
ipcount_all
=
ipResourceRepository
.
count
();
ipCountRecord
.
setIp_using
(
ipcount_using
);
ipCountRecord
.
setIp_all
(
ipcount_all
);
...
...
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