节点读取超时异常处理
This commit is contained in:
parent
b7d1e7b997
commit
7eca1b271e
|
@ -1,27 +1,14 @@
|
||||||
package com.alive.server.api;
|
package com.alive.server.api;
|
||||||
|
|
||||||
import com.alive.db.entity.Vo.RecommendVo;
|
|
||||||
import com.alive.server.config.TwitterConfig;
|
|
||||||
import com.alive.server.oss.AliyunOssUtils;
|
import com.alive.server.oss.AliyunOssUtils;
|
||||||
import com.alive.server.oss.MultipartFileToFileUtil;
|
|
||||||
import com.alive.server.service.TwitterService;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.transaction.annotation.Isolation;
|
import org.springframework.transaction.annotation.Isolation;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -38,14 +25,9 @@ import java.util.UUID;
|
||||||
@Transactional(isolation = Isolation.READ_COMMITTED)
|
@Transactional(isolation = Isolation.READ_COMMITTED)
|
||||||
public class TestController
|
public class TestController
|
||||||
{
|
{
|
||||||
@Autowired
|
|
||||||
private TwitterService twitterService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传文件(阿里OSS)
|
* 上传文件(阿里OSS)
|
||||||
*
|
|
||||||
* @param file 文件对象
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation("上传文件")
|
@ApiOperation("上传文件")
|
||||||
|
|
|
@ -291,8 +291,13 @@ public class CrowdfundingService extends BaseComponent {
|
||||||
try {
|
try {
|
||||||
send = this.getBscWsWeb3j().ethGetLogs(filter).send();
|
send = this.getBscWsWeb3j().ethGetLogs(filter).send();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
String msg = e.getMessage();
|
||||||
throw new RuntimeException(e.getMessage());
|
if(msg.equals("timeout")){
|
||||||
|
log.error("节点读取超时------------------");
|
||||||
|
}else{
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(send.getError() != null && send.getError().getMessage() != null){
|
if(send.getError() != null && send.getError().getMessage() != null){
|
||||||
log.info("扫描块失败(检查节点是否被限制) out {} ,{}, {}", startBlock, endBlock, send.getError().getMessage());
|
log.info("扫描块失败(检查节点是否被限制) out {} ,{}, {}", startBlock, endBlock, send.getError().getMessage());
|
||||||
|
|
|
@ -50,13 +50,6 @@ public class NodeSettingService extends BaseComponent {
|
||||||
@Autowired
|
@Autowired
|
||||||
private DSLContext dslContext;
|
private DSLContext dslContext;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MemberService tMemberService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private Web3jServer web3jServer;
|
|
||||||
|
|
||||||
|
|
||||||
public boolean buyNode() {
|
public boolean buyNode() {
|
||||||
int memberId = Integer.parseInt(RequestUtil.getCurrentAccount());
|
int memberId = Integer.parseInt(RequestUtil.getCurrentAccount());
|
||||||
Integer code = dslContext.selectCount().from(NODE_BUY_LOG).where(NODE_BUY_LOG.USER_ID.eq(memberId).and(NODE_BUY_LOG.STATUS.eq(3))).fetchAnyInto(Integer.class);
|
Integer code = dslContext.selectCount().from(NODE_BUY_LOG).where(NODE_BUY_LOG.USER_ID.eq(memberId).and(NODE_BUY_LOG.STATUS.eq(3))).fetchAnyInto(Integer.class);
|
||||||
|
|
Loading…
Reference in New Issue