Check for S3_SYSTEM_BUCKET_NAME instead of AWS_ENDPOINT_URL_S3

Signed-off-by: Pancakes <patapancakes@pagefault.games>
save-rewrite
Pancakes 2 days ago
parent 8b00b14ffb
commit 02f765c114
No known key found for this signature in database
GPG Key ID: 5792877BFA27DC8F

@ -29,7 +29,7 @@ func GetSystem(uuid []byte) (defs.SystemSaveData, error) {
var system defs.SystemSaveData var system defs.SystemSaveData
var err error var err error
if os.Getenv("AWS_ENDPOINT_URL_S3") != "" { // use S3 if os.Getenv("S3_SYSTEM_BUCKET_NAME") != "" { // use S3
system, err = db.GetSystemSaveFromS3(uuid) system, err = db.GetSystemSaveFromS3(uuid)
} else { // use database } else { // use database
system, err = db.ReadSystemSaveData(uuid) system, err = db.ReadSystemSaveData(uuid)
@ -51,7 +51,7 @@ func UpdateSystem(uuid []byte, data defs.SystemSaveData) error {
return fmt.Errorf("failed to update account stats: %s", err) return fmt.Errorf("failed to update account stats: %s", err)
} }
if os.Getenv("AWS_ENDPOINT_URL_S3") != "" { // use S3 if os.Getenv("S3_SYSTEM_BUCKET_NAME") != "" { // use S3
err = db.StoreSystemSaveDataS3(uuid, data) err = db.StoreSystemSaveDataS3(uuid, data)
} else { } else {
err = db.StoreSystemSaveData(uuid, data) err = db.StoreSystemSaveData(uuid, data)

Loading…
Cancel
Save