Skip to content

Commit

Permalink
删除不必要的字段和操作
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Oct 9, 2024
1 parent 4d0ebe1 commit b1afb15
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.ghostchu.btn.sparkle.module.tracker;

import com.ghostchu.btn.sparkle.controller.SparkleController;
import com.ghostchu.btn.sparkle.module.audit.AuditService;
import com.ghostchu.btn.sparkle.module.tracker.internal.PeerEvent;
import com.ghostchu.btn.sparkle.util.BencodeUtil;
import com.ghostchu.btn.sparkle.util.IPUtil;
Expand Down Expand Up @@ -42,8 +41,6 @@ public class TrackerController extends SparkleController {
@Value("${service.tracker.announce-random}")
private long announceRandomOffset;
@Autowired
private AuditService auditService;
@Autowired
private MeterRegistry meterRegistry;
@Autowired
private StringRedisTemplate redisStringTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ public void executeAnnounce(PeerAnnounce announce) {
ByteUtil.filterUTF8(announce.userAgent()),
OffsetDateTime.now(),
jacksonObjectMapper.writeValueAsString(geoIPManager.geoData(announce.peerIp())),
jacksonObjectMapper.writeValueAsString(geoIPManager.geoData(announce.reqIp())),
0
jacksonObjectMapper.writeValueAsString(geoIPManager.geoData(announce.reqIp()))
);
}
} catch (InterruptedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,4 @@ public class TrackedPeer {
@Type(JsonType.class)
@Basic(fetch = FetchType.LAZY)
private IPGeoData requestGeoIP;
@Column(nullable = false)
@Version
private Integer version;
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ ON CONFLICT (peer_id, torrent_info_hash) DO UPDATE SET \
user_agent = EXCLUDED.user_agent, \
last_time_seen = EXCLUDED.last_time_seen, \
peer_geoip = CAST(EXCLUDED.peer_geoip AS jsonb), \
request_geoip = CAST(EXCLUDED.request_geoip AS jsonb), \
version = EXCLUDED.version""",
request_geoip = CAST(EXCLUDED.request_geoip AS jsonb)""",
nativeQuery = true)
void upsertTrackedPeer(@Param("reqIp") InetAddress reqIp,
@Param("peerId") String peerId,
Expand All @@ -56,8 +55,7 @@ void upsertTrackedPeer(@Param("reqIp") InetAddress reqIp,
@Param("userAgent") String userAgent,
@Param("lastTimeSeen") OffsetDateTime lastTimeSeen,
@Param("peerGeoIP") String peerGeoIP,
@Param("requestGeoIP") String requestGeoIP,
@Param("version") Integer version);
@Param("requestGeoIP") String requestGeoIP);

void deleteByPk_PeerIdAndPk_TorrentInfoHash(String peerId, String infoHash);

Expand Down

0 comments on commit b1afb15

Please sign in to comment.