Skip to content

Commit

Permalink
Add a small progress indicator
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Cameron <[email protected]>
  • Loading branch information
JasonLovesDoggo committed Nov 3, 2024
1 parent 4a9049b commit 92753fb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions handlers/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,7 @@ func copyFile(src, dst string) error {
_, err = io.Copy(destination, source)
return err
}

func (h *FileSystemHandler) Name() string {
return "Filesystem Backup"
}
1 change: 1 addition & 0 deletions handlers/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import "context"

type BackupHandler interface {
Backup(ctx context.Context) (string, error)
Name() string
}
4 changes: 4 additions & 0 deletions handlers/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ func (h *MySQLHandler) Backup(ctx context.Context) (string, error) {

return filename, nil
}

func (h *MySQLHandler) Name() string {
return "MySQL Backup"
}
2 changes: 1 addition & 1 deletion sentinel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func performBackup(handlerList []handlers.BackupHandler, uploader *storage.S3Upl
wg.Add(1)
go func(handler handlers.BackupHandler) {
defer wg.Done()

fmt.Printf("Performing backup: %s\n", handler.Name())
backupFile, err := handler.Backup(ctx)
if err != nil {
errors <- err
Expand Down

0 comments on commit 92753fb

Please sign in to comment.