Skip to content

Commit

Permalink
Refactoring inspired by the code review
Browse files Browse the repository at this point in the history
  • Loading branch information
dkovalev1 committed Oct 3, 2024
1 parent e45e70a commit 247d924
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func DoCleanup() {
logVerbose("Encountered error closing error file: %v", err)
}
}
err := new(RestoreHelper).flushAndCloseRestoreWriter("Current writer pipe on cleanup", 0)
err := Restorer.flushAndCloseRestoreWriter("Current writer pipe on cleanup", 0)
if err != nil {
logVerbose("Encountered error during cleanup: %v", err)
}
Expand Down
5 changes: 3 additions & 2 deletions helper/restore_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const (
)

var (
Restorer IRestoreHelper = new(RestoreHelper)

writeHandle *os.File
writer *bufio.Writer
contentRE *regexp.Regexp
Expand Down Expand Up @@ -171,8 +173,7 @@ func (RestoreHelper) checkForSkipFile(pipeFile string, tableOid int) bool {

func doRestoreAgent() error {
helper := new(Helper)
restorer := new(RestoreHelper)
return doRestoreAgentInternal(helper, restorer)
return doRestoreAgentInternal(helper, Restorer)
}

func doRestoreAgentInternal(h IHelper, rh IRestoreHelper) error {
Expand Down

0 comments on commit 247d924

Please sign in to comment.