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
8cb13cbc
Commit
8cb13cbc
authored
Mar 17, 2021
by
frankiejol
Browse files
refactor(install): lock while installing
parent
6b073c1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
8cb13cbc
...
...
@@ -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
;
...
...
@@ -139,6 +140,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
();
...
...
@@ -146,6 +157,7 @@ sub _install($self) {
$self
->
_update_data
();
$self
->
_init_user_daemon
();
$self
->
_sql_insert_defaults
();
$pid
->
release
();
}
sub
_init_user_daemon
{
...
...
Write
Preview
Supports
Markdown
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