Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hack/high_cpu_usage #176

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 7 additions & 1 deletion ovos_workshop/skill_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from inspect import isclass
from types import ModuleType
from typing import Optional
from time import time
from time import time, sleep
import random
from ovos_bus_client.client import MessageBusClient
from ovos_bus_client.message import Message
from ovos_config.config import Configuration
Expand Down Expand Up @@ -648,6 +649,11 @@ def _launch_script():
Console script entrypoint
USAGE: ovos-skill-launcher {skill_id} [path/to/my/skill_id]
"""
# HACK: this delays each skill by up to 5 seconds
# ensuring they dont all launch at once and cause high cpu usage
# TODO drop in 0.1.0
sleep(random.randint(0, 5000) / 1000)

args_count = len(sys.argv)
if args_count == 2:
skill_id = sys.argv[1]
Expand Down
Loading