@@ -12,7 +12,7 @@ use docs_rs::db::{self, add_path_into_database, Overrides, Pool, PoolClient};
12
12
use docs_rs:: repositories:: RepositoryStatsUpdater ;
13
13
use docs_rs:: utils:: {
14
14
get_config, get_crate_pattern_and_priority, list_crate_priorities, queue_builder,
15
- remove_crate_priority, set_crate_priority, ConfigName ,
15
+ remove_crate_priority, set_config , set_crate_priority, ConfigName ,
16
16
} ;
17
17
use docs_rs:: {
18
18
start_background_metrics_webserver, start_web_server, BuildQueue , Config , Context , Index ,
@@ -383,6 +383,10 @@ enum BuildSubcommand {
383
383
/// Adds essential files for the installed version of rustc
384
384
AddEssentialFiles ,
385
385
386
+ SetToolchain {
387
+ toolchain_name : String ,
388
+ } ,
389
+
386
390
/// Locks the daemon, preventing it from building new crates
387
391
Lock ,
388
392
@@ -459,6 +463,15 @@ impl BuildSubcommand {
459
463
. context ( "failed to add essential files" ) ?;
460
464
}
461
465
466
+ Self :: SetToolchain { toolchain_name } => {
467
+ let mut conn = ctx
468
+ . pool ( ) ?
469
+ . get ( )
470
+ . context ( "failed to get a database connection" ) ?;
471
+ set_config ( & mut conn, ConfigName :: Toolchain , toolchain_name)
472
+ . context ( "failed to set toolchain in database" ) ?;
473
+ }
474
+
462
475
Self :: Lock => build_queue. lock ( ) . context ( "Failed to lock" ) ?,
463
476
Self :: Unlock => build_queue. unlock ( ) . context ( "Failed to unlock" ) ?,
464
477
}
0 commit comments