update 修改个人中心重置密码redis key 问题

This commit is contained in:
yyb
2025-05-30 17:36:15 +08:00
parent ffff88bacf
commit ca86a560dc
6 changed files with 82 additions and 15 deletions

View File

@@ -184,7 +184,7 @@ public class PoolController extends BaseController {
}
@PostMapping("/getMinerPowerFor30min")
@ApiOperation(value = "根据矿工账号从hashrate库获取30m的平均算力")
@ApiOperation(value = "根据矿工账号从hashrate库获取算力")
public AjaxResult getMinerPowerFor30min(@RequestBody MinerMhsVo minerMhsVo){
return poolService.getMinerPowerFor30min(minerMhsVo);
}

View File

@@ -1,5 +1,7 @@
package com.m2pool.pool.task;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.m2pool.common.core.utils.DateUtils;
import com.m2pool.common.core.utils.StringUtils;
import com.m2pool.common.redis.service.RedisService;
@@ -12,6 +14,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@@ -503,20 +507,51 @@ public class NodeTask {
@Scheduled(cron = "0 2 0/1 * * ?")
//@Scheduled(cron = "0 0/2 * * * ?")
public void insertNetBlock(){
Date now = new Date();
now.setMinutes( 0);
now.setSeconds(0);
String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, now);
insertBlockWithRetry("nexa", "nexa_net_block", 5);
insertBlockWithRetry("mona", "mona_net_block", 5);
insertBlockWithRetry("rxd", "rxd_net_block", 5);
insertBlockWithRetry("grs", "grs_net_block", 5);
insertBlockWithAlph(3);
//下列三种币 高度是共用的
insertBlockWithDgbSeries(5);
}
/**
* alph 币种高度入库
*/
private void insertBlockWithAlph(int maxRetries){
int retryCount = 0;
while (retryCount < maxRetries) {
try {
String url = "http://18.141.161.129:12973/blockflow/chain-info?fromGroup=0&toGroup=0";
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type","application/json");
headers.add("User-Agent", "Mozilla/5.0");
headers.add("apikey","0x09e220e226f2feb7a971a2b6f958e7d4b1c187c8");
HttpEntity<String> httpEntity = new HttpEntity<String>(null, headers);
String s = HttpUtil.get(url);
JSONObject jsonObject = JSONObject.parseObject(s);
int currentHeight = jsonObject.getIntValue("currentHeight");
poolMapper.insertNetBlock("alph_net_block", (long) currentHeight);
log.info("插入币种 alph,插入的最新高度为{}",currentHeight);
return;
} catch (Exception e) {
retryCount++;
if (retryCount >= maxRetries) {
log.error("插入区块 alph 数据失败,重试 {} 次后仍失败", maxRetries, e);
break;
}
try {
Thread.sleep(500);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
break;
}
}
}
}
/**
* nexa,mona,rxd,grs 币种高度入库
* @param blockName

View File

@@ -138,6 +138,7 @@ public class NodeRpc{
throw new RuntimeException("当前请求接口的用户过多,请稍后再试");
}
if(result.contains("error:")){
System.out.println("验证地址包含错误:"+result + "钱包地址"+address);
return false;
}else {
JSONObject jsonObject = JSON.parseObject(result);