Skip to content

Commit

Permalink
Ensure Local Secret Persistence is Initialized (#21329)
Browse files Browse the repository at this point in the history
* Formatting

* Ensure that local persistence is initialized
  • Loading branch information
jdpgrailsdev committed Jan 12, 2023
1 parent 94c84f7 commit 5bc38f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void initialize() throws SQLException {
@Override
public Optional<String> read(final SecretCoordinate coordinate) {
return Exceptions.toRuntime(() -> this.configDatabase.query(ctx -> {
initialize();
final var result = ctx.fetch("SELECT payload FROM secrets WHERE coordinate = ?;", coordinate.getFullCoordinate());
if (result.size() == 0) {
return Optional.empty();
Expand All @@ -48,6 +49,7 @@ public Optional<String> read(final SecretCoordinate coordinate) {
@Override
public void write(final SecretCoordinate coordinate, final String payload) {
Exceptions.toRuntime(() -> this.configDatabase.query(ctx -> {
initialize();
ctx.query("INSERT INTO secrets(coordinate,payload) VALUES(?, ?) ON CONFLICT (coordinate) DO UPDATE SET payload = ?;",
coordinate.getFullCoordinate(), payload, payload, coordinate.getFullCoordinate()).execute();
return null;
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-cloud.buildx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
- airbyte/server:${ALT_TAG:-${VERSION}}
platforms:
- linux/amd64
- linux/arm64
- linux/arm64
worker:
image: airbyte/worker:${VERSION}
build:
Expand Down

0 comments on commit 5bc38f0

Please sign in to comment.