Fixed bugs

This commit is contained in:
Luca Frosini 2019-09-24 16:56:02 +02:00
parent a4157eadd2
commit 00ee938aeb
2 changed files with 12 additions and 3 deletions

View File

@ -80,7 +80,7 @@ public class RestSmartExecutor implements SmartExecutor {
PluginManager pluginManager = PluginManager.getInstance();
Map<String, PluginDeclaration> availablePlugins = pluginManager.getAvailablePlugins();
List<PluginDeclaration> plugins = new ArrayList<PluginDeclaration>(availablePlugins.values());
return ExtendedSEMapper.getInstance().marshal(plugins);
return ExtendedSEMapper.getInstance().marshal(PluginDeclaration.class, plugins);
}catch (Exception e) {
throw new ExecutorException(e);
}

View File

@ -264,7 +264,18 @@ public class SmartExecutorScheduler {
JobKey jobKey = new JobKey(uuid.toString());
LaunchParameter launchParameter = getLaunchParameter(jobKey);
ScheduledTaskPersistence stc = ScheduledTaskPersistenceFactory.getScheduledTaskPersistence();
if(launchParameter == null) {
if(remove) {
logger.debug("Going to remove the SmartExecutor Scheduled Task {} from global scheduling if any", uuid);
try {
stc.removeScheduledTask(uuid);
return;
}catch (Exception e) {
}
}
throw new ExecutorException("No plugin with UUID " + uuid.toString() + " found.");
}
Scheduling scheduling = launchParameter.getScheduling();
@ -272,8 +283,6 @@ public class SmartExecutorScheduler {
stopTask(uuid);
ScheduledTaskPersistence stc = ScheduledTaskPersistenceFactory.getScheduledTaskPersistence();
if(scheduled) {
if(remove) {
logger.debug("Going to remove the SmartExecutor Scheduled Task {} from global scheduling", uuid);