@@ -12,14 +12,6 @@ pub struct Core {
12
12
#[ serde( default = "Core::default_mode" ) ]
13
13
pub mode : TrackerMode ,
14
14
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
-
23
15
/// Weather the tracker should collect statistics about tracker usage.
24
16
/// If enabled, the tracker will collect statistics like the number of
25
17
/// connections handled, the number of announce requests handled, etc.
@@ -53,6 +45,10 @@ pub struct Core {
53
45
#[ serde( default = "Core::default_remove_peerless_torrents" ) ]
54
46
pub remove_peerless_torrents : bool ,
55
47
48
+ // Announce policy configuration.
49
+ #[ serde( default = "Core::default_announce_policy" ) ]
50
+ pub announce_policy : AnnouncePolicy ,
51
+
56
52
// Database configuration.
57
53
#[ serde( default = "Core::default_database" ) ]
58
54
pub database : Database ,
@@ -64,17 +60,14 @@ pub struct Core {
64
60
65
61
impl Default for Core {
66
62
fn default ( ) -> Self {
67
- let announce_policy = AnnouncePolicy :: default ( ) ;
68
-
69
63
Self {
70
64
mode : Self :: default_mode ( ) ,
71
- announce_interval : announce_policy. interval ,
72
- min_announce_interval : announce_policy. interval_min ,
73
65
max_peer_timeout : Self :: default_max_peer_timeout ( ) ,
74
66
tracker_usage_statistics : Self :: default_tracker_usage_statistics ( ) ,
75
67
persistent_torrent_completed_stat : Self :: default_persistent_torrent_completed_stat ( ) ,
76
68
inactive_peer_cleanup_interval : Self :: default_inactive_peer_cleanup_interval ( ) ,
77
69
remove_peerless_torrents : Self :: default_remove_peerless_torrents ( ) ,
70
+ announce_policy : Self :: default_announce_policy ( ) ,
78
71
database : Self :: default_database ( ) ,
79
72
net : Self :: default_network ( ) ,
80
73
}
@@ -106,6 +99,10 @@ impl Core {
106
99
true
107
100
}
108
101
102
+ fn default_announce_policy ( ) -> AnnouncePolicy {
103
+ AnnouncePolicy :: default ( )
104
+ }
105
+
109
106
fn default_database ( ) -> Database {
110
107
Database :: default ( )
111
108
}
0 commit comments