fix code style

This commit is contained in:
astroshim 2016-08-28 00:17:24 +09:00
parent 2cea65bff3
commit f9ea386453
2 changed files with 10 additions and 13 deletions

View file

@ -635,7 +635,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', function($scope, $ro
callback: function(result) {
if (result) {
var payload = {
'noteId' : $scope.note.id
'noteId': $scope.note.id
};
$http.put(baseUrlSrv.getRestApiBase() + '/interpreter/setting/restart/' + interpeter.id, payload)

View file

@ -857,22 +857,19 @@ public class InterpreterFactory implements InterpreterGroupFactory {
return noteId == null ? false : true;
}
private boolean isNotSharedInterpreter(InterpreterOption intpOption) {
return intpOption.isPerNoteSession() || intpOption.isConnectExistingProcess();
}
public void restart(String settingId, String noteId) {
InterpreterSetting setting = interpreterSettings.get(settingId);
if (noteIdIsExist(noteId)) {
if (setting.getOption().isPerNoteProcess()) {
setting.closeAndRemoveInterpreterGroup(noteId);
} else if (setting.getOption().isPerNoteSession()) {
InterpreterGroup interpreterGroup = setting.getInterpreterGroup(noteId);
interpreterGroup.close(noteId);
interpreterGroup.destroy(noteId);
} else {
restart(settingId);
}
} else {
restart(settingId);
if (noteIdIsExist(noteId) && isNotSharedInterpreter(setting.getOption())) {
removeInterpretersForNote(setting, noteId);
return;
}
restart(settingId);
}
public void restart(String id) {