Commit 6fa31bb0 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor: work around port conflict on startup

parent b225727c
......@@ -3563,7 +3563,8 @@ sub _kill_dead_process($self) {
"SELECT id,pid,command,start_time "
." FROM requests "
." WHERE start_time<? "
." AND ( status like 'working%' OR status like 'downloading%') "
." AND ( status like 'working%' OR status like 'downloading%'"
." OR status like 'start%' ) "
." AND pid IS NOT NULL "
);
$sth->execute(time - 2);
......
......@@ -1386,6 +1386,11 @@ sub _fix_duplicate_display_port($self, $port) {
if($is_builtin ) {
my $domain_conflict = Ravada::Domain->open($id_domain);
if ($domain_conflict && $domain_conflict->is_active) {
Ravada::Request->refresh_machine(
id_domain=> $domain_conflict->id
,uid => Ravada::Utils::user_daemon->id
,_force => 1
);
my $req = Ravada::Request->shutdown_domain(
id_domain => $self->id
,uid => Ravada::Utils::user_daemon->id
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment