Skip to content

Commit 186c59a

Browse files
load plugins on app start
1 parent 8940336 commit 186c59a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pioreactorui/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from paho.mqtt.enums import CallbackAPIVersion
2121
from pioreactor.config import config as pioreactor_config
2222
from pioreactor.config import get_leader_hostname
23-
from pioreactor.plugin_management import get_plugins
23+
from pioreactor.plugin_management import load_plugins
2424
from pioreactor.whoami import am_I_leader
2525
from pioreactor.whoami import get_unit_name
2626
from pioreactor.whoami import UNIVERSAL_EXPERIMENT
@@ -32,6 +32,9 @@
3232
HOSTNAME = get_unit_name()
3333
NAME = f"pioreactorui-{HOSTNAME}"
3434

35+
# load plugins
36+
load_plugins()
37+
3538

3639
# set up logging
3740
logger = logging.getLogger(NAME)
@@ -117,8 +120,6 @@ def handle_server_error(e):
117120
app.json = MsgspecJsonProvider(app)
118121
app.get_json = app.json.loads
119122

120-
get_plugins()
121-
122123
return app
123124

124125

pioreactorui/unit_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
from .utils import create_task_response
4444
from pioreactorui import structs
4545

46-
AllCalibrations = subclass_union(CalibrationBase)
4746

47+
AllCalibrations = subclass_union(CalibrationBase)
4848

4949
unit_api = Blueprint("unit_api", __name__, url_prefix="/unit_api")
5050

0 commit comments

Comments
 (0)