Skip to content

Commit

Permalink
Add enable-webrtc-task-check
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Nov 30, 2023
1 parent 460215a commit ff9fd29
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/cli/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ pub fn enable_thread_counter() -> bool {
.is_present("enable-thread-counter");
}

pub fn enable_webrtc_task_test() -> Option<u32> {
return MANAGER
.as_ref()
.clap_matches
.value_of("enable-webrtc-task-test")
.and_then(|value| value.parse::<u32>().ok());
}

// Return the command line used to start this application
pub fn command_line_string() -> String {
std::env::args().collect::<Vec<String>>().join(" ")
Expand Down Expand Up @@ -230,6 +238,14 @@ fn get_clap_matches<'a>() -> clap::ArgMatches<'a> {
.long("enable-thread-counter")
.help("Enable a thread that prints the number of children processes.")
.takes_value(false),
)
.arg(
clap::Arg::with_name("enable-webrtc-task-test")
.long("enable-webrtc-task-test")
.help("Enable webrtc thread test with limit of child tasks (can use port for webdriver as parameter).")
.value_name("PORT")
.default_value("9515")
.empty_values(true)
);

matches.get_matches()
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ async fn main() -> Result<(), std::io::Error> {
helper::threads::start_thread_counter_thread();
}

if cli::manager::enable_webrtc_task_test().is_some() {
helper::develop::start_check_tasks_on_webrtc_reconnects();
}

stream::webrtc::signalling_server::SignallingServer::default();

if let Err(error) = stream::manager::start_default() {
Expand Down

0 comments on commit ff9fd29

Please sign in to comment.