Command line option to ignore index cache
This commit is contained in:
parent
89a5aac6ea
commit
63a05ff6fa
8
main.go
8
main.go
|
@ -26,6 +26,7 @@ type Options struct {
|
||||||
Listen string `short:"l" long:"listen" description:"Listen address" default:":22000" value-name:"ADDR"`
|
Listen string `short:"l" long:"listen" description:"Listen address" default:":22000" value-name:"ADDR"`
|
||||||
ReadOnly bool `short:"r" long:"ro" description:"Repository is read only"`
|
ReadOnly bool `short:"r" long:"ro" description:"Repository is read only"`
|
||||||
Delete bool `short:"d" long:"delete" description:"Delete files deleted from cluster"`
|
Delete bool `short:"d" long:"delete" description:"Delete files deleted from cluster"`
|
||||||
|
Rehash bool `long:"rehash" description:"Ignore cache and rehash all files in repository"`
|
||||||
NoSymlinks bool `long:"no-symlinks" description:"Don't follow first level symlinks in the repo"`
|
NoSymlinks bool `long:"no-symlinks" description:"Don't follow first level symlinks in the repo"`
|
||||||
Discovery DiscoveryOptions `group:"Discovery Options"`
|
Discovery DiscoveryOptions `group:"Discovery Options"`
|
||||||
Advanced AdvancedOptions `group:"Advanced Options"`
|
Advanced AdvancedOptions `group:"Advanced Options"`
|
||||||
|
@ -140,8 +141,11 @@ func main() {
|
||||||
// Walk the repository and update the local model before establishing any
|
// Walk the repository and update the local model before establishing any
|
||||||
// connections to other nodes.
|
// connections to other nodes.
|
||||||
|
|
||||||
infoln("Initial repository scan in progress")
|
if !opts.Rehash {
|
||||||
loadIndex(m)
|
infoln("Loading index cache")
|
||||||
|
loadIndex(m)
|
||||||
|
}
|
||||||
|
infoln("Populating repository index")
|
||||||
updateLocalModel(m)
|
updateLocalModel(m)
|
||||||
|
|
||||||
// Routine to listen for incoming connections
|
// Routine to listen for incoming connections
|
||||||
|
|
Loading…
Reference in New Issue