Skip to content

Commit bd94596

Browse files
author
Andrew Farries
committed
Obtain and log signed upload URL
Show that the connection to the content service is up and running by requesting a signed upload URL and logging it.
1 parent 851e957 commit bd94596

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

components/usage/pkg/controller/reconciler.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,17 @@ func (u *UsageReconciler) Reconcile() (err error) {
9191
}
9292

9393
stat, err := f.Stat()
94+
filePath := filepath.Join(dir, stat.Name())
9495
if err != nil {
9596
return fmt.Errorf("failed to get file stats: %w", err)
9697
}
97-
log.Infof("Wrote usage report into %s", filepath.Join(dir, stat.Name()))
98+
log.Infof("Wrote usage report into %s", filePath)
99+
100+
uploadURL, err := u.contentService.GetSignedUploadUrl(ctx)
101+
if err != nil {
102+
return fmt.Errorf("failed to obtain signed upload URL: %w", err)
103+
}
104+
log.Infof("signed upload url: %s", uploadURL)
98105

99106
err = db.CreateUsageRecords(ctx, u.conn, usageReportToUsageRecords(report, u.pricer, u.nowFunc().UTC()))
100107
if err != nil {

0 commit comments

Comments
 (0)