sequence problem when creating domains fixed

This commit is contained in:
Peter Hormanns 2024-07-29 14:41:13 +02:00
parent e8c256da9c
commit ca9215d5a1

View File

@ -35,7 +35,11 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
UnixUser domUser = dom.getUser();
Pac pac = domUser.getPac();
WaitingTasksProcessor mainProcessor = new WaitingTasksProcessor(
new CompoundProcessor(new ShellProcessor("salt-call state.sls pacs"))
new CompoundProcessor(
new ShellProcessor("salt-call state.sls pacs"),
createDomainDirectoriesProcessor(dom),
createApacheVHostSetupProcessor(em, dom)
)
);
Config config = Config.getInstance();
for (String queueName : config.getProperty("queues.dns").split(",")) {
@ -44,24 +48,23 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
for (String queueName : config.getProperty("queues.mail").split(",")) {
mainProcessor.appendProcessor(queueName, createMailinSetupProcessor(em, dom, pac), queueName + ".hostsharing.net");
}
mainProcessor.appendProcessor(hiveName, createDomainDirectoriesProcessor(dom), "Setup Domain Directories");
mainProcessor.appendProcessor(hiveName, createApacheVHostSetupProcessor(em, dom), "Setup Apache VHost");
mainProcessor.appendProcessor(hiveName, createTriggerAcmebotProcessor(em, dom), "Trigger ACMEBot");
return mainProcessor;
}
public <T extends AbstractEntity> Processor createUpdateProcessor(final EntityManager em, final T entity) throws ProcessorException {
String hiveName = entity.getHiveName();
final Domain dom = (Domain) entity;
final UnixUser domUser = dom.getUser();
final Pac pac = domUser.getPac();
final Processor apacheVHostSetupProcessor = createApacheVHostSetupProcessor(em, dom);
final Processor triggerAcmebotProcessor = createTriggerAcmebotProcessor(em, dom);
final WaitingTasksProcessor processor = new WaitingTasksProcessor(
new CompoundProcessor(new ShellProcessor("salt-call state.sls pacs"), apacheVHostSetupProcessor, triggerAcmebotProcessor));
new CompoundProcessor(new ShellProcessor("salt-call state.sls pacs"), apacheVHostSetupProcessor));
final Config config = Config.getInstance();
for (String queueName : config.getProperty("queues.mail").split(",")) {
processor.appendProcessor(queueName, createMailinSetupProcessor(em, dom, pac), queueName + ".hostsharing.net");
}
processor.appendProcessor(hiveName, createTriggerAcmebotProcessor(em, dom), "Trigger ACMEBot");
return processor;
}