Remove code comments
This commit is contained in:
parent
a5e58493d8
commit
52d7c13013
17 changed files with 18 additions and 335 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -1,7 +1,3 @@
|
|||
//! rustbot binary — a per-network connect/reconnect supervisor built on the
|
||||
//! `rustbot` library. All the real logic lives in the library
|
||||
//! (`config`, `irc`, `bot`); this file only spawns and keeps sessions alive.
|
||||
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
|
|
@ -24,10 +20,6 @@ fn main() {
|
|||
names.join(", ")
|
||||
));
|
||||
|
||||
// One supervisor thread per network. Each keeps its own connection alive
|
||||
// with independent reconnect/backoff, so a failure on one network never
|
||||
// disturbs the others. Labels appear in the logs only when there is more
|
||||
// than one network, keeping single-network output terse and unchanged.
|
||||
let labelled = configs.len() > 1;
|
||||
let mut handles = Vec::new();
|
||||
for config in configs {
|
||||
|
|
@ -43,9 +35,6 @@ fn main() {
|
|||
}
|
||||
}
|
||||
|
||||
/// Keep one network's bot alive across disconnects, with capped exponential
|
||||
/// backoff. Runs until the process is killed. When `labelled`, log lines are
|
||||
/// tagged with the network name so multiple networks stay distinguishable.
|
||||
fn supervise(config: Config, labelled: bool) {
|
||||
let tag = if labelled {
|
||||
format!("[{}] ", config.name)
|
||||
|
|
@ -71,8 +60,6 @@ fn supervise(config: Config, labelled: bool) {
|
|||
}
|
||||
}
|
||||
|
||||
/// Run a single connection lifecycle for one network: connect, register, loop
|
||||
/// until disconnect.
|
||||
fn run_once(config: &Config, labelled: bool) -> std::io::Result<()> {
|
||||
let mut conn = Connection::connect(&config.server, config.port, config.tls)?;
|
||||
if labelled {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue