You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New console command to upload torrent to the Index remotely by using the
API client.
```console
cargo run --bin seeder -- --api-base-url <API_BASE_URL> --number-of-torrents <NUMBER_OF_TORRENTS> --user <USER> --password <PASSWORD> --interval <INTERVAL>
```
For example:
```console
cargo run --bin seeder -- --api-base-url "localhost:3001" --number-of-torrents 1000 --user admin --password 12345678 --interval 0
```
That command would upload 1000 random torrents to the Index using the user
account `admin` with password `123456` and waiting `1` second between uploads.
/// Will not return any errors for the time being.
39
-
pubfnrun() -> anyhow::Result<()>{
40
-
setup_logging(LevelFilter::Info);
68
+
pubasyncfnrun() -> anyhow::Result<()>{
69
+
logging::setup(LevelFilter::Info);
41
70
42
71
let args = Args::parse();
43
72
44
-
println!("Number of torrents: {}", args.number_of_torrents);
45
-
println!("User: {}", args.user);
46
-
println!("Password: {}", args.password);
47
-
println!("Interval: {:?}", args.interval);
73
+
let api_user = login_index_api(&args.api_base_url,&args.user,&args.password).await;
74
+
75
+
let api_client = Client::authenticated(&args.api_base_url,&api_user.token);
76
+
77
+
info!(target:"seeder","Uploading { } random torrents to the Torrust Index with a { } seconds interval...", args.number_of_torrents.to_string().yellow(), args.interval.to_string().yellow());
48
78
49
-
/* todo:
50
-
- Use a client to upload a random torrent every "interval" seconds.
0 commit comments