Skip to content

Commit 7dda1f1

Browse files
authored
Merge pull request #14 from opencobra/constructor_dev
fix: launch Matlab when needed
2 parents 59024e0 + e958bfd commit 7dda1f1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

curationTool/reactions/apps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ class ReactionsConfig(AppConfig):
66
default_auto_field = "django.db.models.BigAutoField"
77
name = "reactions"
88

9-
def ready(self):
10-
# Start MATLAB session once at startup
11-
MatlabSessionManager()
9+

curationTool/reactions/views/vmh_views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ def add_to_vmh(request):
577577
metabolite_abbr=abbr,
578578
)
579579
else:
580+
matlab_session.quit()
580581
return JsonResponse(
581582
{'status': 'error', 'message': matlab_result['message']})
582583
reaction_formulas = [
@@ -634,10 +635,12 @@ def add_to_vmh(request):
634635
workspace = Workspace.objects.get(user=user)
635636
reaction_obj = reaction_objs[idx] # already loaded!
636637
workspace.reactions.remove(reaction_obj)
638+
matlab_session.quit()
637639
return JsonResponse({'status': 'success',
638640
'rxn_added_info': rxn_added_info,
639641
'met_added_info': met_added_info})
640642

643+
matlab_session.quit()
641644
return JsonResponse(
642645
{'status': 'error', 'message': matlab_result['message']})
643646

0 commit comments

Comments
 (0)