diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2021-08-17 14:35:44 -0500 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-08-26 20:04:29 +0000 |
commit | 79b13ac2a166eea535deceade405e8b99b098c64 (patch) | |
tree | 0e979a6eebb7119d74b780a38dc387af5325ffe3 /server/sonar-ce/src | |
parent | 680aed78d5a58249ae56ca36b5f495bb579bce1a (diff) | |
download | sonarqube-79b13ac2a166eea535deceade405e8b99b098c64.tar.gz sonarqube-79b13ac2a166eea535deceade405e8b99b098c64.zip |
SONAR-15142 Always add AuditPersister to container and use typed NewValue for each audit
Diffstat (limited to 'server/sonar-ce/src')
-rw-r--r-- | server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java | 5 | ||||
-rw-r--r-- | server/sonar-ce/src/main/java/org/sonar/ce/db/ReadOnlyPropertiesDao.java | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java index e8204854e61..23fd2289ce2 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/container/ComputeEngineContainerImpl.java @@ -83,6 +83,8 @@ import org.sonar.db.DaoModule; import org.sonar.db.DbClient; import org.sonar.db.DefaultDatabase; import org.sonar.db.MyBatis; +import org.sonar.db.audit.AuditPersister; +import org.sonar.db.audit.NoOpAuditPersister; import org.sonar.db.purge.PurgeProfiler; import org.sonar.process.NetworkUtilsImpl; import org.sonar.process.Props; @@ -203,6 +205,9 @@ public class ComputeEngineContainerImpl implements ComputeEngineContainer { level1.getComponentByType(CECoreExtensionsInstaller.class) .install(level1, hasPlatformLevel(1), noAdditionalSideFilter()); + if (level1.getComponentByType(AuditPersister.class) == null) { + level1.add(NoOpAuditPersister.class); + } level1.startComponents(); } diff --git a/server/sonar-ce/src/main/java/org/sonar/ce/db/ReadOnlyPropertiesDao.java b/server/sonar-ce/src/main/java/org/sonar/ce/db/ReadOnlyPropertiesDao.java index ea1c3b3475c..ab6511fc7b3 100644 --- a/server/sonar-ce/src/main/java/org/sonar/ce/db/ReadOnlyPropertiesDao.java +++ b/server/sonar-ce/src/main/java/org/sonar/ce/db/ReadOnlyPropertiesDao.java @@ -25,6 +25,7 @@ import org.sonar.api.utils.System2; import org.sonar.core.util.UuidFactory; import org.sonar.db.DbSession; import org.sonar.db.MyBatis; +import org.sonar.db.audit.NoOpAuditPersister; import org.sonar.db.property.PropertiesDao; import org.sonar.db.property.PropertyDto; @@ -39,7 +40,7 @@ import org.sonar.db.property.PropertyDto; */ public class ReadOnlyPropertiesDao extends PropertiesDao { public ReadOnlyPropertiesDao(MyBatis mybatis, System2 system2, UuidFactory uuidFactory) { - super(mybatis, system2, uuidFactory); + super(mybatis, system2, uuidFactory, new NoOpAuditPersister()); } @Override |