Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Remove git locks when starting mycroft #1715

Merged
merged 1 commit into from
Aug 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions mycroft/skills/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,16 @@ def load_priority(self):
continue
self._load_or_reload_skill(skill.path)

def remove_git_locks(self):
"""If git gets killed from an abrupt shutdown it leaves lock files"""
for i in glob(join(self.msm.skills_dir, '*/.git/index.lock')):
LOG.warning('Found and removed git lock file: ' + i)
os.remove(i)

def run(self):
""" Load skills and update periodically from disk and internet """

# Load priority skills first, in order (very first time this will
# occur before MSM has run)

self.remove_git_locks()
self._connected_event.wait()
has_loaded = False

Expand Down