Skip to content

Commit

Permalink
Merge branch 'testing' of https://github.com/nyaruka/rp-archiver into…
Browse files Browse the repository at this point in the history
… testing
  • Loading branch information
nicpottier committed May 16, 2018
2 parents ee9aff3 + 5017c0f commit 651c54b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions archiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ func CreateArchiveFile(ctx context.Context, db *sqlx.DB, archive *Archive, archi
return nil
}

// UploadArchive upload file to S3
func UploadArchive(ctx context.Context, s3Client s3iface.S3API, bucket string, archive *Archive) error {
// s3 wants a base64 encoded hash instead of our hex encoded
hashBytes, _ := hex.DecodeString(archive.ArchiveHash)
Expand Down Expand Up @@ -396,6 +397,7 @@ INSERT INTO archives_archive(archive_type, org_id, created_on, start_date, perio
RETURNING id
`

// WriteArchiveToDB write an archive to the Database
func WriteArchiveToDB(ctx context.Context, db *sqlx.DB, archive *Archive) error {
archive.OrgID = archive.Org.ID
archive.CreatedOn = time.Now()
Expand Down

0 comments on commit 651c54b

Please sign in to comment.