@@ -481,13 +481,14 @@ use crate::CurrentClock;
481481/// > Typically, the `Tracker` is used by a higher application service that handles
482482/// > the network layer.
483483pub struct Tracker {
484+ // The tracker configuration.
484485 config : Core ,
485486 /// A database driver implementation: [`Sqlite3`](crate::core::databases::sqlite)
486487 /// or [`MySQL`](crate::core::databases::mysql)
487- pub database : Arc < Box < dyn Database > > ,
488+ database : Arc < Box < dyn Database > > ,
488489 keys : tokio:: sync:: RwLock < std:: collections:: HashMap < Key , auth:: ExpiringKey > > ,
489490 whitelist : tokio:: sync:: RwLock < std:: collections:: HashSet < InfoHash > > ,
490- pub torrents : Arc < Torrents > ,
491+ torrents : Arc < Torrents > ,
491492 stats_event_sender : Option < Box < dyn statistics:: EventSender > > ,
492493 stats_repository : statistics:: Repo ,
493494}
@@ -987,6 +988,17 @@ impl Tracker {
987988 Some ( stats_event_sender) => stats_event_sender. send_event ( event) . await ,
988989 }
989990 }
991+
992+ /// It drops the database tables.
993+ ///
994+ /// # Errors
995+ ///
996+ /// Will return `Err` if unable to drop tables.
997+ pub fn drop_database_tables ( & self ) -> Result < ( ) , databases:: error:: Error > {
998+ // todo: this is only used for testing. WE have to pass the database
999+ // reference directly to the tests instead of via the tracker.
1000+ self . database . drop_database_tables ( )
1001+ }
9901002}
9911003
9921004#[ must_use]
0 commit comments