Skip to content

Commit

Permalink
Merge pull request #108 from nyaruka/upload_s3_fix
Browse files Browse the repository at this point in the history
Fix uploading archives
  • Loading branch information
rowanseymour authored Aug 23, 2024
2 parents ecaef03 + 38cde6c commit 97c9086
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions archives/archives.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,13 +556,13 @@ func UploadArchive(ctx context.Context, rt *runtime.Runtime, archive *Archive) e
archivePath := ""
if archive.Period == DayPeriod {
archivePath = fmt.Sprintf(
"/%d/%s_%s%d%02d%02d_%s.jsonl.gz",
"%d/%s_%s%d%02d%02d_%s.jsonl.gz",
archive.Org.ID, archive.ArchiveType, archive.Period,
archive.StartDate.Year(), archive.StartDate.Month(), archive.StartDate.Day(),
archive.Hash)
} else {
archivePath = fmt.Sprintf(
"/%d/%s_%s%d%02d_%s.jsonl.gz",
"%d/%s_%s%d%02d_%s.jsonl.gz",
archive.Org.ID, archive.ArchiveType, archive.Period,
archive.StartDate.Year(), archive.StartDate.Month(),
archive.Hash)
Expand Down
2 changes: 1 addition & 1 deletion archives/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/nyaruka/rp-archiver/runtime"
)

const s3BucketURL = "https://%s.s3.amazonaws.com%s"
const s3BucketURL = "https://%s.s3.amazonaws.com/%s"

// any file over this needs to be uploaded in chunks
const maxSingleUploadBytes = 5e9 // 5GB
Expand Down

0 comments on commit 97c9086

Please sign in to comment.