|
|
@@ -179,7 +179,7 @@ public class SpotifyServiceImpl implements SpotifyService {
|
|
|
for (ProxyInfo proxyInfo : proxyInfos) {
|
|
|
try {
|
|
|
log.info("执行:info:{}", proxyInfo);
|
|
|
- Proxy proxy = new Proxy(Proxy.Type.HTTP,
|
|
|
+ Proxy proxy = new Proxy(Proxy.Type.SOCKS,
|
|
|
new InetSocketAddress(proxyInfo.getIp(), proxyInfo.getPort()));
|
|
|
request.setProxy(proxy);
|
|
|
HttpResponse response = request.execute();
|
|
|
@@ -195,9 +195,8 @@ public class SpotifyServiceImpl implements SpotifyService {
|
|
|
log.info("spotify 注册 被监测出代理服务 。 删除该代理 ip:{}", proxyInfo.getIp());
|
|
|
if (proxyInfo.getId() != null) {
|
|
|
int count = proxysMapper.deleteById(proxyInfo.getId());
|
|
|
- if(count == 0){
|
|
|
- redisService.del(RedisKey.DOVEIP);
|
|
|
- }
|
|
|
+ }else {
|
|
|
+ redisService.del(RedisKey.DOVEIP);
|
|
|
}
|
|
|
continue;
|
|
|
}
|
|
|
@@ -230,6 +229,8 @@ public class SpotifyServiceImpl implements SpotifyService {
|
|
|
} catch (Exception e) {
|
|
|
if (proxyInfo.getId() != null) {
|
|
|
proxysMapper.deleteById(proxyInfo.getId());
|
|
|
+ }else {
|
|
|
+ redisService.del(RedisKey.DOVEIP);
|
|
|
}
|
|
|
e.printStackTrace();
|
|
|
log.error("错误 ip:{}", proxyInfo.getIp());
|