Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
f25f31ac
Commit
f25f31ac
authored
Mar 17, 2021
by
frankiejol
Committed by
Francesc Guasch
Mar 17, 2021
Browse files
refactor(install): lock while installing
parent
54f8d06b
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
f25f31ac
...
...
@@ -13,6 +13,7 @@ use Hash::Util qw(unlock_hash lock_hash);
use
JSON::
XS
;
use
Moose
;
use
POSIX
qw(WNOHANG)
;
use
Proc::PID::
File
;
use
Time::
HiRes
qw(gettimeofday tv_interval)
;
use
YAML
;
use
MIME::
Base64
;
...
...
@@ -142,6 +143,16 @@ sub BUILD {
}
sub
_install
($self) {
my
$pid
=
Proc::PID::
File
->
new
(
name
=>
"
ravada_install
");
if
(
$pid
->
alive
)
{
print
"
Waiting for install process to finish
"
if
$ENV
{
TERM
};
while
(
$pid
->
alive
)
{
sleep
1
;
print
"
.
"
if
$ENV
{
TERM
};
}
print
"
\n
"
if
$ENV
{
TERM
};
}
$pid
->
touch
;
$self
->
_sql_create_tables
();
$self
->
_create_tables
();
$self
->
_upgrade_tables
();
...
...
@@ -150,6 +161,7 @@ sub _install($self) {
$self
->
_init_user_daemon
();
$self
->
_sql_insert_defaults
();
print
"
\n
"
if
$FIRST_TIME_RUN
;
$pid
->
release
();
}
sub
_init_user_daemon
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment