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
bd18c76d
Commit
bd18c76d
authored
May 09, 2020
by
renjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-zrj' into 'staging'
自有专线bug See merge request
!72
parents
b6ddfece
403f0f42
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
Set3proxyTask.java
.../com/edgec/browserbackend/browser/task/Set3proxyTask.java
+8
-9
No files found.
src/main/java/com/edgec/browserbackend/browser/task/Set3proxyTask.java
View file @
bd18c76d
...
@@ -48,20 +48,19 @@ public class Set3proxyTask {
...
@@ -48,20 +48,19 @@ public class Set3proxyTask {
@SchedulerLock
(
name
=
"proxyTask"
,
lockAtLeastFor
=
60
*
1000
*
5
,
lockAtMostFor
=
60
*
1000
*
9
)
@SchedulerLock
(
name
=
"proxyTask"
,
lockAtLeastFor
=
60
*
1000
*
5
,
lockAtMostFor
=
60
*
1000
*
9
)
public
void
set3proxy
()
{
public
void
set3proxy
()
{
long
validTime
=
Instant
.
now
().
minusSeconds
(
43200
).
toEpochMilli
();
long
validTime
=
Instant
.
now
().
minusSeconds
(
43200
).
toEpochMilli
();
if
(
proxyConfigRepository
.
count
()
>
0
)
{
long
nowtime
=
Instant
.
now
().
toEpochMilli
();
ProxyConfig
proxyConfig
=
proxyConfigRepository
.
findAll
().
get
(
0
);
if
(
Instant
.
now
().
toEpochMilli
()
<
proxyConfig
.
getTimestamp
())
return
;
}
// List<String> tokenUsernames = mongoOAuth2AccessTokenRepository.findByCreatedAtGreaterThan(validTime).stream().map(MongoOAuth2AccessToken::getUsername).collect(Collectors.toList());
// List<String> tokenUsernames = mongoOAuth2AccessTokenRepository.findByCreatedAtGreaterThan(validTime).stream().map(MongoOAuth2AccessToken::getUsername).collect(Collectors.toList());
// List<String> accountParents = accountRepository.findByNameIn(tokenUsernames).stream().map(x -> x.getParent() == null ? x.getName() : x.getParent()).distinct().collect(Collectors.toList());
// List<String> accountParents = accountRepository.findByNameIn(tokenUsernames).stream().map(x -> x.getParent() == null ? x.getName() : x.getParent()).distinct().collect(Collectors.toList());
// List<IpResource> ipResources = ipResourceRepository.findByOwnerInAndSpecialLine(accountParents, true);
// List<IpResource> ipResources = ipResourceRepository.findByOwnerInAndSpecialLine(accountParents, true);
List
<
IpResource
>
ipResources
=
ipResourceRepository
.
findBySpecialLineAndIsDeleted
(
true
,
false
);
List
<
IpResource
>
ipResources
=
ipResourceRepository
.
findBySpecialLineAndIsDeleted
(
true
,
false
);
File
file
=
new
File
(
"3proxy
"
+
Instant
.
now
().
toEpochMilli
());
File
file
=
new
File
(
"3proxy
_
"
+
Instant
.
now
().
toEpochMilli
());
SpecialLine
specialLine
=
specialLineRepository
.
findAll
().
get
(
0
);
try
{
try
{
try
{
file
.
delete
();
file
.
delete
();
file
.
createNewFile
();
file
.
createNewFile
();
}
catch
(
Exception
t1
)
{
log
.
error
(
t1
.
getMessage
(),
t1
);
}
FileWriter
fileWriter
=
new
FileWriter
(
file
,
true
);
FileWriter
fileWriter
=
new
FileWriter
(
file
,
true
);
BufferedWriter
bw
=
new
BufferedWriter
(
fileWriter
);
BufferedWriter
bw
=
new
BufferedWriter
(
fileWriter
);
...
@@ -85,7 +84,7 @@ public class Set3proxyTask {
...
@@ -85,7 +84,7 @@ public class Set3proxyTask {
bw
.
flush
();
bw
.
flush
();
bw
.
close
();
bw
.
close
();
log
.
error
(
"成功写入文件"
);
log
.
error
(
"成功写入文件"
);
long
nowtime
=
Instant
.
now
().
toEpochMilli
();
if
(
proxyConfigRepository
.
count
()
>
0
)
{
if
(
proxyConfigRepository
.
count
()
>
0
)
{
ProxyConfig
proxyConfig
=
proxyConfigRepository
.
findAll
().
get
(
0
);
ProxyConfig
proxyConfig
=
proxyConfigRepository
.
findAll
().
get
(
0
);
if
(
nowtime
<
proxyConfig
.
getTimestamp
())
{
if
(
nowtime
<
proxyConfig
.
getTimestamp
())
{
...
@@ -101,7 +100,7 @@ public class Set3proxyTask {
...
@@ -101,7 +100,7 @@ public class Set3proxyTask {
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"出错了"
);
log
.
error
(
"出错了"
);
log
.
error
(
e
.
getMessage
());
log
.
error
(
e
.
getMessage
()
,
e
);
}
}
}
}
...
...
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