Commit 0cbea79 1 parent 5d3cec1 commit 0cbea79 Copy full SHA for 0cbea79
File tree 1 file changed +6
-1
lines changed
src/main/java/com/ghostchu/peerbanhelper/module/impl/rule
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 33
33
import java .util .Optional ;
34
34
import java .util .concurrent .ExecutorService ;
35
35
import java .util .concurrent .TimeUnit ;
36
+ import java .util .concurrent .TimeoutException ;
36
37
37
38
@ Component
38
39
@ IgnoreScan
@@ -107,7 +108,11 @@ public void reloadConfig() {
107
108
return getCache ().readCache (this , reverseDnsLookupString , () -> {
108
109
Optional <String > ptr ;
109
110
if (laboratory .isExperimentActivated (Experiments .DNSJAVA .getExperiment ())) {
110
- ptr = dnsLookup .ptr (reverseDnsLookupString ).get (3 , TimeUnit .SECONDS );
111
+ try {
112
+ ptr = dnsLookup .ptr (reverseDnsLookupString ).get (3 , TimeUnit .SECONDS );
113
+ } catch (TimeoutException e ) {
114
+ ptr = Optional .empty ();
115
+ }
111
116
} else {
112
117
try {
113
118
ptr = Optional .ofNullable (InetAddress .getByName (peer .getPeerAddress ().getIp ()).getHostName ());
You can’t perform that action at this time.
0 commit comments