Skip to content

Commit

Permalink
撤销无效更改
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Sep 20, 2024
1 parent e818bf0 commit e1791d0
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ private void loadBanListToMemory() {
log.info(tlUI(Lang.LOAD_BANLIST_FROM_FILE, data.size()));
downloaders.forEach(downloader -> {
downloader.login();
downloader.setBanList(generateFullPeerAddress(), null, null, true);
downloader.setBanList(BAN_LIST.keySet(), null, null, true);
});
Collection<TorrentWrapper> relaunch = data.values().stream().map(BanMetadata::getTorrent).toList();
downloaders.forEach(downloader -> downloader.relaunchTorrentIfNeededByTorrentWrapper(relaunch));
Expand Down Expand Up @@ -595,7 +595,7 @@ public void updateDownloader(@NotNull Downloader downloader, boolean updateBanLi
} else {
downloader.setLastStatus(DownloaderLastStatus.HEALTHY, loginResult.getMessage());
}
downloader.setBanList(generateFullPeerAddress(), added, removed, applyFullList);
downloader.setBanList(BAN_LIST.keySet(), added, removed, applyFullList);
downloader.relaunchTorrentIfNeeded(needToRelaunch);
} catch (Throwable th) {
log.error(tlUI(Lang.ERR_UPDATE_BAN_LIST, downloader.getName(), downloader.getEndpoint()), th);
Expand Down Expand Up @@ -889,13 +889,6 @@ public JavalinWebContainer getWebContainer() {
return webContainer;
}

public Collection<PeerAddress> generateFullPeerAddress(){
Set<PeerAddress> addresses = new HashSet<>();
addresses.addAll(BAN_LIST.values().stream().map(ban -> new PeerAddress(ban.getPeer().getRawIp(), ban.getPeer().getAddress().getPort())).toList());
addresses.addAll(BAN_LIST.values().stream().map(ban -> new PeerAddress(ban.getPeer().getAddress().getIp(), ban.getPeer().getAddress().getPort())).toList());
return addresses;
}

public record IPDBResponse(
LazyLoad<IPGeoData> geoData
) {
Expand Down

0 comments on commit e1791d0

Please sign in to comment.