Skip to content

Commit

Permalink
fix: load migrators conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
cleydyr committed Mar 31, 2024
1 parent b24dcae commit 229d828
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

@Component
@ConditionalOnProperty(name = "DIGITAL_MEDIA_MIGRATOR")
public class DigitalMediaStoreMigratorInitializingBean implements InitializingBean {
private Map<String, DigitalMediaStoreMigrator> digitalMediaMigratorMap;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
import org.postgresql.largeobject.LargeObject;
import org.postgresql.largeobject.LargeObjectManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
import software.amazon.awssdk.core.sync.RequestBody;
import software.amazon.awssdk.services.s3.S3Client;
import software.amazon.awssdk.services.s3.model.PutObjectRequest;

@Component
@ConditionalOnProperty(name = "DIGITAL_MEDIA_MIGRATOR")
@Slf4j
public class PGToS3DigitalMediaMigrator implements DigitalMediaStoreMigrator {
private S3Client s3;
Expand Down

0 comments on commit 229d828

Please sign in to comment.