Skip to content

Commit

Permalink
Fix oracle config
Browse files Browse the repository at this point in the history
  • Loading branch information
xpdota committed Aug 28, 2024
1 parent 3f9153e commit fdbe5ce
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DataManager implements AutoCloseable {
private static final int maxIlvlFood = 999


DataManager(DataPersistence pers, JsonConfiguration js) {
DataManager(DataPersistence pers) {
this.pers = pers
client = new XivApiClient()
xivApiUpdater = Thread.startVirtualThread this.&xivApiUpdateLoop
Expand Down Expand Up @@ -81,6 +81,7 @@ class DataManager implements AutoCloseable {

void persistData(FullData newData) {
try {
log.info "Persistence: Pushing Data"
pers.data = newData
}
catch (Throwable t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import groovy.util.logging.Slf4j
import io.micronaut.core.annotation.Nullable
import io.micronaut.objectstorage.ObjectStorageEntry
import io.micronaut.objectstorage.ObjectStorageOperations
import io.micronaut.objectstorage.configuration.ObjectStorageConfiguration
import io.micronaut.objectstorage.local.LocalStorageConfiguration
import io.micronaut.objectstorage.oraclecloud.OracleCloudStorageConfiguration
import io.micronaut.objectstorage.oraclecloud.OracleCloudStorageOperations
import io.micronaut.objectstorage.request.UploadRequest
import jakarta.inject.Singleton

Expand Down Expand Up @@ -49,6 +53,7 @@ class DataPersistence {

void setData(FullData data) {
if (data == null) {
log.info "Deleting data"
storage.delete key
}
else {
Expand All @@ -61,6 +66,7 @@ class DataPersistence {
gzipOut.finish()
bytes = baos.toByteArray()
}
log.info "Uploading data"
storage.upload UploadRequest.fromBytes(bytes, key)
}
}
Expand Down
16 changes: 11 additions & 5 deletions src/main/resources/application-prodoci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ micronaut:
enabled: true
bucket: ${OBJECT_STORAGE_BUCKET_NAME:xivgear-data}
namespace: ${ORACLE_CLOUD_OBJECT_STORAGE_NAMESPACE:}
region: ${ORACLE_CLOUD_OBJECT_STORAGE_REGION:}
compartment-id: ${ORACLE_CLOUD_COMPARTMENT_ID:}
auth:
tenant-id: ${ORACLE_CLOUD_TENANT_ID:}
user-id: ${ORACLE_CLOUD_USER_ID:}
fingerprint: ${ORACLE_CLOUD_FINGERPRINT:}
private-key-path: ${ORACLE_CLOUD_PEM_PATH:}
local:
default:
enabled: false

oci:
# config:
# instance-principal:
# enabled: false

tenant-id: ${ORACLE_CLOUD_TENANT_ID:}
user-id: ${ORACLE_CLOUD_USER_ID:}
fingerprint: ${ORACLE_CLOUD_FINGERPRINT:}
private-key-file: file:${ORACLE_CLOUD_PEM_PATH:}
region: ${ORACLE_CLOUD_OBJECT_STORAGE_REGION:}

0 comments on commit fdbe5ce

Please sign in to comment.