Skip to content

Commit

Permalink
Use separate scans for separate networks
Browse files Browse the repository at this point in the history
  • Loading branch information
firelizzard18 committed Jun 14, 2024
1 parent 9a639ef commit ad9f5e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/cmd/debug/heal_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ var cmdHeal = &cobra.Command{
var flagMaxResponseAge time.Duration = time.Minute

func init() {
peerDb = filepath.Join(currentUser.HomeDir, ".accumulate", "cache", "peerdb.json")
lightDb = filepath.Join(currentUser.HomeDir, ".accumulate", "cache", "light.db")

cmd.AddCommand(cmdHeal)
Expand All @@ -57,7 +56,7 @@ func init() {
cmdHeal.PersistentFlags().BoolVarP(&pretend, "pretend", "n", false, "Do not submit envelopes, only scan")
cmdHeal.PersistentFlags().BoolVar(&waitForTxn, "wait", false, "Wait for the message to finalize (defaults to true for heal synth)")
cmdHeal.PersistentFlags().BoolVar(&healContinuous, "continuous", false, "Run healing in a loop every minute")
cmdHeal.PersistentFlags().StringVar(&peerDb, "peer-db", peerDb, "Track peers using a persistent database")
cmdHeal.PersistentFlags().StringVar(&peerDb, "peer-db", "", "Track peers using a persistent database")
cmdHeal.PersistentFlags().StringVar(&pprof, "pprof", "", "Address to run net/http/pprof on")
cmdHeal.PersistentFlags().BoolVar(&debug, "debug", false, "Debug network requests")
cmdHealAnchor.PersistentFlags().DurationVar(&flagMaxResponseAge, "max-response-age", flagMaxResponseAge, "Maximum age of a response before it is considered too stale to use")
Expand All @@ -66,6 +65,9 @@ func init() {
_ = cmdHeal.MarkFlagFilename("cached-scan", ".json")

cmdHeal.PersistentPreRun = func(cmd *cobra.Command, args []string) {
if !cmd.Flag("peer-db").Changed {
peerDb = filepath.Join(currentUser.HomeDir, ".accumulate", "cache", strings.ToLower(args[0])+"-peers.json")
}
if !cmd.Flag("cached-scan").Changed {
cachedScan = filepath.Join(currentUser.HomeDir, ".accumulate", "cache", strings.ToLower(args[0])+".json")
}
Expand Down

0 comments on commit ad9f5e6

Please sign in to comment.