fix: Added checks to only return plugins when new updates are present

This commit is contained in:
Nidhi Nair 2023-09-26 18:43:16 +05:30
parent f763e75b9c
commit e3d08140d4
2 changed files with 20 additions and 3 deletions

View File

@ -1,6 +1,8 @@
package com.appsmith.server.services; package com.appsmith.server.services;
import com.appsmith.server.repositories.ApplicationRepository;
import com.appsmith.server.repositories.ConfigRepository; import com.appsmith.server.repositories.ConfigRepository;
import com.appsmith.server.repositories.DatasourceRepository;
import com.appsmith.server.services.ce.ConfigServiceCEImpl; import com.appsmith.server.services.ce.ConfigServiceCEImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -9,7 +11,11 @@ import org.springframework.stereotype.Service;
@Service @Service
public class ConfigServiceImpl extends ConfigServiceCEImpl implements ConfigService { public class ConfigServiceImpl extends ConfigServiceCEImpl implements ConfigService {
public ConfigServiceImpl(ConfigRepository repository) { public ConfigServiceImpl(
super(repository); ConfigRepository repository,
ApplicationRepository applicationRepository,
DatasourceRepository datasourceRepository) {
super(repository, applicationRepository, datasourceRepository);
} }
} }

View File

@ -8,7 +8,9 @@ import com.appsmith.server.domains.Config;
import com.appsmith.server.domains.User; import com.appsmith.server.domains.User;
import com.appsmith.server.exceptions.AppsmithError; import com.appsmith.server.exceptions.AppsmithError;
import com.appsmith.server.exceptions.AppsmithException; import com.appsmith.server.exceptions.AppsmithException;
import com.appsmith.server.repositories.ApplicationRepository;
import com.appsmith.server.repositories.ConfigRepository; import com.appsmith.server.repositories.ConfigRepository;
import com.appsmith.server.repositories.DatasourceRepository;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.minidev.json.JSONObject; import net.minidev.json.JSONObject;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
@ -22,12 +24,21 @@ import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
@Slf4j @Slf4j
public class ConfigServiceCEImpl implements ConfigServiceCE { public class ConfigServiceCEImpl implements ConfigServiceCE {
private static final String TEMPLATE_WORKSPACE_CONFIG_NAME = "template-workspace";
private final ConfigRepository repository; private final ConfigRepository repository;
private final ApplicationRepository applicationRepository;
private final DatasourceRepository datasourceRepository;
// This is permanently cached through the life of the JVM process as this is not intended to change at runtime ever. // This is permanently cached through the life of the JVM process as this is not intended to change at runtime ever.
private String instanceId = null; private String instanceId = null;
public ConfigServiceCEImpl(ConfigRepository repository) { public ConfigServiceCEImpl(
ConfigRepository repository,
ApplicationRepository applicationRepository,
DatasourceRepository datasourceRepository) {
this.applicationRepository = applicationRepository;
this.datasourceRepository = datasourceRepository;
this.repository = repository; this.repository = repository;
} }