Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
searchhotcrawler
Overview
Overview
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
zhiwei
searchhotcrawler
Commits
7fde64b8
Commit
7fde64b8
authored
Jul 17, 2018
by
zhiwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加错误日志打印
parent
8ae3d2d2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
src/main/java/com/zhiwei/searchhotcrawler/run/HotSearchRun.java
+2
-1
src/main/java/com/zhiwei/searchhotcrawler/timer/SendZhihuHotSearchRun.java
+5
-0
src/main/java/com/zhiwei/searchhotcrawler/util/WechatCodeUtil.java
+3
-1
No files found.
src/main/java/com/zhiwei/searchhotcrawler/run/HotSearchRun.java
View file @
7fde64b8
...
@@ -5,6 +5,7 @@ import java.util.concurrent.ScheduledExecutorService;
...
@@ -5,6 +5,7 @@ import java.util.concurrent.ScheduledExecutorService;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
com.zhiwei.searchhotcrawler.cache.CacheListener
;
import
com.zhiwei.searchhotcrawler.cache.CacheListener
;
import
com.zhiwei.searchhotcrawler.timer.SendWeiboHotSearchRun
;
import
com.zhiwei.searchhotcrawler.timer.SendZhihuHotSearchRun
;
import
com.zhiwei.searchhotcrawler.timer.SendZhihuHotSearchRun
;
import
com.zhiwei.searchhotcrawler.timer.WeiboHotSearchRun
;
import
com.zhiwei.searchhotcrawler.timer.WeiboHotSearchRun
;
import
com.zhiwei.searchhotcrawler.timer.ZhihuHotSearchRun
;
import
com.zhiwei.searchhotcrawler.timer.ZhihuHotSearchRun
;
...
@@ -22,7 +23,7 @@ public class HotSearchRun {
...
@@ -22,7 +23,7 @@ public class HotSearchRun {
scheduExec
.
scheduleAtFixedRate
(
new
WeiboHotSearchRun
(),
0
,
1
,
TimeUnit
.
MINUTES
);
scheduExec
.
scheduleAtFixedRate
(
new
WeiboHotSearchRun
(),
0
,
1
,
TimeUnit
.
MINUTES
);
scheduExec
.
scheduleAtFixedRate
(
new
ZhihuHotSearchRun
(),
0
,
1
,
TimeUnit
.
MINUTES
);
scheduExec
.
scheduleAtFixedRate
(
new
ZhihuHotSearchRun
(),
0
,
1
,
TimeUnit
.
MINUTES
);
scheduExec
.
scheduleAtFixedRate
(
new
SendZhihuHotSearchRun
(),
0
,
60
,
TimeUnit
.
MINUTES
);
scheduExec
.
scheduleAtFixedRate
(
new
SendZhihuHotSearchRun
(),
0
,
60
,
TimeUnit
.
MINUTES
);
//
scheduExec.scheduleAtFixedRate(new SendWeiboHotSearchRun(), 0, 60 , TimeUnit.MINUTES);
scheduExec
.
scheduleAtFixedRate
(
new
SendWeiboHotSearchRun
(),
0
,
60
,
TimeUnit
.
MINUTES
);
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/com/zhiwei/searchhotcrawler/timer/SendZhihuHotSearchRun.java
View file @
7fde64b8
...
@@ -74,6 +74,7 @@ public class SendZhihuHotSearchRun extends Thread{
...
@@ -74,6 +74,7 @@ public class SendZhihuHotSearchRun extends Thread{
dataMap
.
put
(
"remark"
,
remark
);
dataMap
.
put
(
"remark"
,
remark
);
List
<
String
>
userList
=
getUserList
();
List
<
String
>
userList
=
getUserList
();
if
(
userList
!=
null
&&
userList
.
size
()>
0
)
{
for
(
String
openId
:
userList
)
{
for
(
String
openId
:
userList
)
{
Template
template
=
new
Template
();
Template
template
=
new
Template
();
template
.
setTouser
(
openId
);
template
.
setTouser
(
openId
);
...
@@ -86,6 +87,10 @@ public class SendZhihuHotSearchRun extends Thread{
...
@@ -86,6 +87,10 @@ public class SendZhihuHotSearchRun extends Thread{
JSONObject
templateJson
=
(
JSONObject
)
JSONObject
.
toJSON
(
template
);
JSONObject
templateJson
=
(
JSONObject
)
JSONObject
.
toJSON
(
template
);
WechatCodeUtil
.
sendDataJson
(
templateJson
);
WechatCodeUtil
.
sendDataJson
(
templateJson
);
}
}
}
else
{
logger
.
info
(
"知乎推送拉取用户列表失败"
);
}
}
}
/**
/**
...
...
src/main/java/com/zhiwei/searchhotcrawler/util/WechatCodeUtil.java
View file @
7fde64b8
...
@@ -61,10 +61,12 @@ public class WechatCodeUtil {
...
@@ -61,10 +61,12 @@ public class WechatCodeUtil {
if
(
null
!=
jsonObject
)
{
if
(
null
!=
jsonObject
)
{
if
(
"ok"
.
equals
(
jsonObject
.
getString
(
"errmsg"
)))
{
if
(
"ok"
.
equals
(
jsonObject
.
getString
(
"errmsg"
)))
{
msgid
=
jsonObject
.
getIntValue
(
"msgid"
);
msgid
=
jsonObject
.
getIntValue
(
"msgid"
);
}
else
{
logger
.
info
(
"消息推送失败,错误为::{}"
,
jsonObject
.
toString
());
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
"消息推送失败,错误为::{}"
,
e
.
fillInStackTrace
()
);
msgid
=
0
;
msgid
=
0
;
}
}
return
msgid
;
return
msgid
;
...
...
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