From 63a05ff6fa8e89b8200dfe519450189bb4a6dcaf Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 1 Jan 2014 16:31:35 -0500 Subject: [PATCH] Command line option to ignore index cache --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 1eb5588e7..5ff6ab699 100644 --- a/main.go +++ b/main.go @@ -26,6 +26,7 @@ type Options struct { 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"` 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"` Discovery DiscoveryOptions `group:"Discovery Options"` Advanced AdvancedOptions `group:"Advanced Options"` @@ -140,8 +141,11 @@ func main() { // Walk the repository and update the local model before establishing any // connections to other nodes. - infoln("Initial repository scan in progress") - loadIndex(m) + if !opts.Rehash { + infoln("Loading index cache") + loadIndex(m) + } + infoln("Populating repository index") updateLocalModel(m) // Routine to listen for incoming connections