File tree Expand file tree Collapse file tree 5 files changed +22
-5
lines changed
resources/templates/common Expand file tree Collapse file tree 5 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 1
1
# saber
2
2
【 Spring Boot 实战开发】10 分钟快速构建一个自己的技术文章博客
3
+
4
+
5
+
6
+ ### JVM启动参数
7
+
8
+ ``` -XX:-UseGCOverheadLimit -Xms256m -Xmx1024m ```
9
+
10
+
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import com.light.saber.dao.CrawSourceDao
4
4
import com.light.saber.dao.KnowledgeDao
5
5
import com.light.saber.model.Knowledge
6
6
import com.light.saber.webclient.CrawlerWebClient
7
+ import kotlinx.coroutines.experimental.CommonPool
8
+ import kotlinx.coroutines.experimental.launch
7
9
import org.jsoup.Jsoup
8
10
import org.jsoup.nodes.Document
9
11
import org.jsoup.nodes.Element
@@ -23,7 +25,9 @@ class CrawKnowledgeService {
23
25
简书专题URLs .forEach {
24
26
for (page in 1 .. 100 ) {
25
27
try {
26
- crawJianShuArticles(page, it.url)
28
+ launch(CommonPool ) {
29
+ crawJianShuArticles(page, it.url)
30
+ }
27
31
} catch (e: Exception ) {
28
32
29
33
}
@@ -36,7 +40,9 @@ class CrawKnowledgeService {
36
40
fun doCrawSegmentFaultKnowledge () {
37
41
for (page in 1 .. 803 ) {
38
42
try {
39
- crawSegmentFault(page)
43
+ launch(CommonPool ) {
44
+ crawSegmentFault(page)
45
+ }
40
46
} catch (e: Exception ) {
41
47
42
48
}
@@ -47,7 +53,9 @@ class CrawKnowledgeService {
47
53
fun doCrawOSChinaKnowledge () {
48
54
for (page in 1 .. 560 ) {
49
55
try {
50
- crawOSChina(page)
56
+ launch(CommonPool ) {
57
+ crawOSChina(page)
58
+ }
51
59
} catch (e: Exception ) {
52
60
53
61
}
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ object CrawlerWebClient {
23
23
}
24
24
25
25
fun getPageHtmlText (url : String ): String? {
26
- webClient = instanceWebClient(7000 )
26
+ webClient = instanceWebClient(3000 )
27
27
try {
28
28
return webClient?.getPage<HtmlPage >(url)?.asXml()
29
29
} catch (e: Exception ) {
Original file line number Diff line number Diff line change 1
1
</div >
2
2
<div class =" layui-footer" style =" text-align : center " >
3
3
<!-- 底部固定区域 -->
4
- 微技 GD(MircoTek GD), 最懂你的工作伴侣。 © microtek-gd.com
4
+ 微技 GD © microtek-gd.com
5
5
</div >
6
6
</div >
7
7
</body >
Original file line number Diff line number Diff line change 63
63
<li class =" layui-nav-item" ><a href =" " >机器人管理</a ></li >
64
64
<li class =" layui-nav-item" ><a href =" " >发布服务</a ></li >
65
65
</ul >
66
+
66
67
</div >
67
68
</div >
68
69
You can’t perform that action at this time.
0 commit comments