summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJokler <jokler.contact@gmail.com>2017-12-24 15:27:14 +0100
committerJokler <jokler.contact@gmail.com>2017-12-24 15:27:14 +0100
commit32e870aeefee587d6eabdfa08cf27b3cf9a46f15 (patch)
tree4313a3abec20b2038be6f1f416fc6d3352fb3c8d /bin
parent92ea5a1c2e0b7ddaa102d6b602d180e84964c3be (diff)
downloadfrippy-32e870aeefee587d6eabdfa08cf27b3cf9a46f15.tar.gz
frippy-32e870aeefee587d6eabdfa08cf27b3cf9a46f15.zip
Exit if no bot connected successfully
Diffstat (limited to 'bin')
-rw-r--r--bin/main.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/main.rs b/bin/main.rs
index 420e016..c9749b6 100644
--- a/bin/main.rs
+++ b/bin/main.rs
@@ -78,6 +78,7 @@ fn main() {
// Create an event loop to run the connections on.
let mut reactor = Core::new().unwrap();
+ let mut task = false;
// Open a connection and add work for each config
for config in configs {
@@ -104,9 +105,11 @@ fn main() {
}
}
- bot.connect(&mut reactor, &config);
+ bot.connect(&mut reactor, &config).map(|_| task = true);
}
- // Run the main loop forever
- reactor.run(future::empty::<(), ()>()).unwrap();
+ if task {
+ // Run the main loop forever
+ reactor.run(future::empty::<(), ()>()).unwrap();
+ }
}