mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-02-09 01:59:16 +08:00
prints running coroutines
This commit is contained in:
@@ -177,6 +177,15 @@ fn main() {
|
||||
.ok().expect("`threads` should be an integer");
|
||||
|
||||
Scheduler::new().with_workers(threads).run(move|| {
|
||||
if matches.occurrences_of("VERBOSE") >= 1 {
|
||||
Scheduler::spawn(move|| {
|
||||
loop {
|
||||
coio::sleep_ms(1000);
|
||||
debug!("Running coroutines: {}", Scheduler::instance().work_count());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
RelayLocal::new(config).run();
|
||||
}).unwrap();
|
||||
}
|
||||
|
||||
@@ -171,6 +171,15 @@ fn main() {
|
||||
.ok().expect("`threads` should be an integer");
|
||||
|
||||
Scheduler::new().with_workers(threads).run(move|| {
|
||||
if matches.occurrences_of("VERBOSE") >= 1 {
|
||||
Scheduler::spawn(move|| {
|
||||
loop {
|
||||
coio::sleep_ms(1000);
|
||||
debug!("Running coroutines: {}", Scheduler::instance().work_count());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
RelayServer::new(config).run();
|
||||
}).unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user