Skip to content

Commit

Permalink
Merge branch 'fwwkr/drive-create-non-empty-only' into fwwkr/master
Browse files Browse the repository at this point in the history
  • Loading branch information
mawaya committed Jul 3, 2020
2 parents ef0ad3d + 51378c8 commit 2ba1833
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 4 additions & 5 deletions fs/accounting/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,18 +287,17 @@ func (s *StatsInfo) String() string {

// Mod
fpsString = fmt.Sprintf("%.2f Files/s", fspeed)
fpsOneLineString = ""
fpsOneLineString = ""
)


if !fs.Config.StatsOneLine {
_, _ = fmt.Fprintf(buf, "\nTransferred: ")
} else {
xfrchk := []string{}
if totalTransfer > 0 && s.transferQueue > 0 {
if totalTransfer > 0 { // && s.transferQueue > 0 {
xfrchk = append(xfrchk, fmt.Sprintf("xfr#%d/%d", s.transfers, totalTransfer))
}
if totalChecks > 0 && s.checkQueue > 0 {
if totalChecks > 0 { // && s.checkQueue > 0 {
xfrchk = append(xfrchk, fmt.Sprintf("chk#%d/%d", s.checks, totalChecks))
}
if len(xfrchk) > 0 {
Expand Down Expand Up @@ -352,7 +351,7 @@ func (s *StatsInfo) String() string {
if s.transfers != 0 || totalTransfer != 0 {
// Mod: Add number of files
_, _ = fmt.Fprintf(buf, "Transferred: %10d / %d, %s, %s, ETA %s\n",
s.transfers, totalTransfer, percent(s.transfers, totalTransfer), fpsString,
s.transfers, totalTransfer, percent(s.transfers, totalTransfer), fpsString,
etaString(s.transfers, totalTransfer, fspeed))
}
_, _ = fmt.Fprintf(buf, "Elapsed time: %10ss\n", strings.TrimRight(dt.Truncate(time.Minute).String(), "0s")+fmt.Sprintf("%.1f", dtSecondsOnly.Seconds()))
Expand Down
5 changes: 5 additions & 0 deletions fs/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,11 @@ func (s *syncCopyMove) run() error {
// Stop background checking and transferring pipeline
s.stopCheckers()
if s.checkFirst {
for d := range s.srcEmptyDirs {
if _, ok := s.srcOnlyDirs[d]; ok {
delete(s.srcOnlyDirs, d)
}
}
s.processError(createNewDirectories(s.ctx, s.fdst, s.srcOnlyDirs))

fs.Infof(s.fdst, "Checks finished, now starting transfers")
Expand Down

0 comments on commit 2ba1833

Please sign in to comment.