@@ -12,14 +12,6 @@ pub struct Core {
1212 #[ serde( default = "Core::default_mode" ) ]
1313 pub mode : TrackerMode ,
1414
15- /// See [`AnnouncePolicy::interval`]
16- #[ serde( default = "AnnouncePolicy::default_interval" ) ]
17- pub announce_interval : u32 ,
18-
19- /// See [`AnnouncePolicy::interval_min`]
20- #[ serde( default = "AnnouncePolicy::default_interval_min" ) ]
21- pub min_announce_interval : u32 ,
22-
2315 /// Weather the tracker should collect statistics about tracker usage.
2416 /// If enabled, the tracker will collect statistics like the number of
2517 /// connections handled, the number of announce requests handled, etc.
@@ -53,6 +45,10 @@ pub struct Core {
5345 #[ serde( default = "Core::default_remove_peerless_torrents" ) ]
5446 pub remove_peerless_torrents : bool ,
5547
48+ // Announce policy configuration.
49+ #[ serde( default = "Core::default_announce_policy" ) ]
50+ pub announce_policy : AnnouncePolicy ,
51+
5652 // Database configuration.
5753 #[ serde( default = "Core::default_database" ) ]
5854 pub database : Database ,
@@ -64,17 +60,14 @@ pub struct Core {
6460
6561impl Default for Core {
6662 fn default ( ) -> Self {
67- let announce_policy = AnnouncePolicy :: default ( ) ;
68-
6963 Self {
7064 mode : Self :: default_mode ( ) ,
71- announce_interval : announce_policy. interval ,
72- min_announce_interval : announce_policy. interval_min ,
7365 max_peer_timeout : Self :: default_max_peer_timeout ( ) ,
7466 tracker_usage_statistics : Self :: default_tracker_usage_statistics ( ) ,
7567 persistent_torrent_completed_stat : Self :: default_persistent_torrent_completed_stat ( ) ,
7668 inactive_peer_cleanup_interval : Self :: default_inactive_peer_cleanup_interval ( ) ,
7769 remove_peerless_torrents : Self :: default_remove_peerless_torrents ( ) ,
70+ announce_policy : Self :: default_announce_policy ( ) ,
7871 database : Self :: default_database ( ) ,
7972 net : Self :: default_network ( ) ,
8073 }
@@ -106,6 +99,10 @@ impl Core {
10699 true
107100 }
108101
102+ fn default_announce_policy ( ) -> AnnouncePolicy {
103+ AnnouncePolicy :: default ( )
104+ }
105+
109106 fn default_database ( ) -> Database {
110107 Database :: default ( )
111108 }
0 commit comments