mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 12:36:38 +08:00
Run ls in parallel so can parallelise the slow ModTime operations
This commit is contained in:
parent
ecb863dd4f
commit
12015b0007
|
@ -1,6 +1,8 @@
|
|||
Todo
|
||||
* FIXME: More -dry-run checks for object transfer
|
||||
* FIXME ls is very slow also - need to run mtimes in parallel
|
||||
* Ignoring the pseudo directories
|
||||
* if object.PseudoDirectory {
|
||||
* fmt.Printf("%9s %19s %s\n", "Directory", "-", fs.Remote())
|
||||
* Check logging in various parts
|
||||
* Make logging controllable with flags (mostly done)
|
||||
* progress meter would be nice! Do this by wrapping the Reader with a progress bar
|
||||
|
|
24
swiftsync.go
24
swiftsync.go
|
@ -241,20 +241,22 @@ func Check(fdst, fsrc Fs) {
|
|||
}
|
||||
|
||||
// List the Fs to stdout
|
||||
//
|
||||
// Lists in parallel which may get them out of order
|
||||
func List(f Fs) {
|
||||
// FIXME error?
|
||||
in := f.List()
|
||||
for fs := range in {
|
||||
// FIXME
|
||||
// if object.PseudoDirectory {
|
||||
// fmt.Printf("%9s %19s %s\n", "Directory", "-", fs.Remote())
|
||||
// } else {
|
||||
// FIXME ModTime is expensive?
|
||||
modTime := fs.ModTime()
|
||||
fmt.Printf("%9d %19s %s\n", fs.Size(), modTime.Format("2006-01-02 15:04:05"), fs.Remote())
|
||||
// fmt.Printf("%9d %19s %s\n", fs.Size(), object.LastModified.Format("2006-01-02 15:04:05"), fs.Remote())
|
||||
// }
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(*checkers)
|
||||
for i := 0; i < *checkers; i++ {
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for fs := range in {
|
||||
modTime := fs.ModTime()
|
||||
fmt.Printf("%9d %19s %s\n", fs.Size(), modTime.Format("2006-01-02 15:04:05"), fs.Remote())
|
||||
}
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
// Lists files in a container
|
||||
|
|
Loading…
Reference in New Issue
Block a user