Skip to content

Commit 5d28fb1

Browse files
committed
HOTFIX: double-check experiment isn't already running before starting another
1 parent 7162d92 commit 5d28fb1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

+srv/expServer.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ function handleMessage(id, data, host)
186186
case 'run'
187187
% exp run request
188188
[expRef, preDelay, postDelay, AlyxInstance] = args{:};
189+
% assert that experiment not already running
190+
if ~isempty(experiment)
191+
failMsg = sprintf(...
192+
'Failed because another experiment (ref ''%s'') running', ...
193+
experiment.Data.expRef);
194+
log(failMsg);
195+
communicator.send(id, {'fail', expRef, failMsg});
196+
return
197+
end
189198
if isempty(AlyxInstance); AlyxInstance = Alyx('',''); end
190199
AlyxInstance.Headless = true; % Supress all dialog prompts
191200
if dat.expExists(expRef)

0 commit comments

Comments
 (0)