Skip to content

Commit

Permalink
Check for S3_SYSTEM_BUCKET_NAME instead of AWS_ENDPOINT_URL_S3
Browse files Browse the repository at this point in the history
Signed-off-by: Pancakes <[email protected]>
  • Loading branch information
patapancakes committed Jan 20, 2025
1 parent 8b00b14 commit 02f765c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/savedata/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func GetSystem(uuid []byte) (defs.SystemSaveData, error) {
var system defs.SystemSaveData
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)
} else { // use database
system, err = db.ReadSystemSaveData(uuid)
Expand All @@ -51,7 +51,7 @@ func UpdateSystem(uuid []byte, data defs.SystemSaveData) error {
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)
} else {
err = db.StoreSystemSaveData(uuid, data)
Expand Down

0 comments on commit 02f765c

Please sign in to comment.