6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-14 06:58:21 +00:00
tutor/bin/main.py
Régis Behmo facc0b84e1 Make tutor considerably faster
Tutor was making many calls to iter_installed (~100 on my machine with a
dozen installed plugins). Turns out it's useless to cache Plugin and
Renderer instances, as the config keeps changing all the time. Instead,
we cache the list of installed plugins, which does not change in the
course of a single run.

On my machine this speeds up `tutor config save` by 5x, going from 7.5s
to 1.3s.
2020-10-15 16:28:55 +02:00

22 lines
384 B
Python
Executable File

#!/usr/bin/env python3
from tutor.plugins import OfficialPlugin
# Manually install plugins (this is for creating the bundle)
for plugin_name in [
"discovery",
"ecommerce",
# "figures",
"lts",
"minio",
"notes",
"xqueue",
]:
try:
OfficialPlugin.load(plugin_name)
except ImportError:
pass
from tutor.commands.cli import main
main()