Skip to content

Commit

Permalink
Merge pull request #2231 from MycroftAI/bugfix/mycroft-msm-lock
Browse files Browse the repository at this point in the history
Limit creation attempts of msm-lock
  • Loading branch information
forslund committed Jul 24, 2019
2 parents dbf0da6 + 846723c commit 875d147
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mycroft/skills/msm_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,23 @@
from os.path import join, expanduser, exists

from msm import MycroftSkillsManager, SkillRepo

from mycroft.util.combo_lock import ComboLock
from mycroft.util.log import LOG

mycroft_msm_lock = ComboLock('/tmp/mycroft-msm.lck')
mycroft_msm_lock = None


def create_msm(config):
""" Create msm object from config. """
global mycroft_msm_lock
if mycroft_msm_lock is None:
try:
mycroft_msm_lock = ComboLock('/tmp/mycroft-msm.lck')
LOG.debug('mycroft-msm combo lock created')
except Exception as e:
LOG.error('Failed to create msm lock ({})'.format(repr(e)))

msm_config = config['skills']['msm']
repo_config = msm_config['repo']
data_dir = expanduser(config['data_dir'])
Expand Down

0 comments on commit 875d147

Please sign in to comment.