Merge pull request #1498 from MycroftAI/bugfix/msm-hanging

Fix msm lock hanging forever
pull/1504/head
Åke 2018-03-22 14:10:42 -05:00 committed by GitHub
commit c02e4ee175
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 11 deletions

19
msm/msm
View File

@ -130,10 +130,7 @@ function send_start_install () {
fi fi
} }
function send_start_update () { function send_start_update () {
if [[ "${update_started}" == "false" ]] ; then python -m mycroft.messagebus.send msm.updating
python -m mycroft.messagebus.send msm.updating
update_started="true"
fi
} }
function send_start_remove () { function send_start_remove () {
if [[ "${remove_started}" == "false" ]] ; then if [[ "${remove_started}" == "false" ]] ; then
@ -159,9 +156,7 @@ function send_end_install () {
fi fi
} }
function send_end_update () { function send_end_update () {
if [[ "${update_started}" == "true" ]] ; then python -m mycroft.messagebus.send msm.updated
python -m mycroft.messagebus.send msm.updated
fi
} }
function send_end_remove () { function send_end_remove () {
if [[ "${remove_started}" == "true" ]] ; then if [[ "${remove_started}" == "true" ]] ; then
@ -531,8 +526,8 @@ function update() {
echo "Updating installed skills..." echo "Updating installed skills..."
cd "${mycroft_skill_folder}" cd "${mycroft_skill_folder}"
send_start_update & send_start_update
pids=("$!") pids=()
# Loop through all of the current Skill folders # Loop through all of the current Skill folders
for d in $(find "${mycroft_skill_folder}" -mindepth 1 -maxdepth 1 -type d |grep -v '.git'$ ); do for d in $(find "${mycroft_skill_folder}" -mindepth 1 -maxdepth 1 -type d |grep -v '.git'$ ); do
@ -543,7 +538,9 @@ function update() {
pids+=("$!") pids+=("$!")
fi fi
done done
wait $pids for pid in "${pids[@]}"; do
wait $pid
done
# TODO: Remove this for 18.02 # TODO: Remove this for 18.02
# HACK: Only do the re-PIP once per boot # HACK: Only do the re-PIP once per boot
@ -740,7 +737,7 @@ case ${OPT} in
fi fi
# Create .msm file to provide timestamp for last msm default # Create .msm file to provide timestamp for last msm default
rm ${mycroft_skill_folder}/.msm rm -f ${mycroft_skill_folder}/.msm
printf "" > ${mycroft_skill_folder}/.msm.tmp printf "" > ${mycroft_skill_folder}/.msm.tmp
# These skills are automatically installed on all mycroft-core # These skills are automatically installed on all mycroft-core
# installations. # installations.