We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d92dc83 + 5412731 commit 71b7dfbCopy full SHA for 71b7dfb
webmagic-extension/src/main/java/us/codecraft/webmagic/monitor/SpiderStatus.java
@@ -84,8 +84,13 @@ public Date getStartTime() {
84
85
@Override
86
public int getPagePerSecond() {
87
- int runSeconds = (int) (System.currentTimeMillis() - getStartTime().getTime()) / 1000;
88
- return getSuccessPageCount() / runSeconds;
+ if (getStartTime() != null) {
+ int runSeconds = (int) (System.currentTimeMillis() - getStartTime().getTime()) / 1000;
89
+ if (runSeconds != 0) {
90
+ return getSuccessPageCount() / runSeconds;
91
+ }
92
93
+ return -1;
94
}
95
96
0 commit comments