Only mirror regular files

This commit is contained in:
Harshavardhana
2015-08-03 19:08:33 -07:00
parent 64b8782af3
commit 4c7559317d
2 changed files with 12 additions and 14 deletions
+6 -12
View File
@@ -17,21 +17,15 @@ func ifFatal(err *probe.Error) {
}
}
func ifError(err error) {
switch e := err.(type) {
case *probe.Error:
switch e {
case nil:
// nothing to print
default:
if !globalDebugFlag {
console.Errorln(e.ToError())
}
console.Errorln(err)
}
func ifError(err *probe.Error) {
switch err {
case nil:
// nothing to print
default:
if !globalDebugFlag {
console.Errorln(err.ToError())
return
}
console.Errorln(err)
}
}
+6 -2
View File
@@ -128,7 +128,9 @@ func deltaSourceTargets(sourceClnt client.Client, targetClnts []client.Client) <
mirrorURLsCh <- mirrorURLs{Error: sourceContentCh.Err.Trace()}
return
}
sourceTrie.Insert(patricia.Prefix(sourceContentCh.Content.Name), sourceContentCh.Content.Size)
if sourceContentCh.Content.Type.IsRegular() {
sourceTrie.Insert(patricia.Prefix(sourceContentCh.Content.Name), sourceContentCh.Content.Size)
}
}
}()
@@ -142,7 +144,9 @@ func deltaSourceTargets(sourceClnt client.Client, targetClnts []client.Client) <
mirrorURLsCh <- mirrorURLs{Error: targetContentCh.Err.Trace()}
return
}
targetTrie.Insert(patricia.Prefix(targetContentCh.Content.Name), struct{}{})
if targetContentCh.Content.Type.IsRegular() {
targetTrie.Insert(patricia.Prefix(targetContentCh.Content.Name), struct{}{})
}
}
targetTries[i] = targetTrie
}(i, targetClnt)