tMitigate Redis(Cli) bug by not panicking on the error. - tordam - A library for peer discovery inside the Tor network
 (HTM) git clone https://git.parazyd.org/tordam
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit ef38cb97dc4fd75a6953b3d75acbede095807db3
 (DIR) parent cafa0dc4bc3eea39112002a70f705130d23db746
 (HTM) Author: parazyd <parazyd@dyne.org>
       Date:   Tue, 23 Oct 2018 12:37:21 +0200
       
       Mitigate Redis(Cli) bug by not panicking on the error.
       
       Diffstat:
         M cmd/dam-client/main.go              |       7 ++++++-
         M contrib/redis.conf                  |       2 +-
       
       2 files changed, 7 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/cmd/dam-client/main.go b/cmd/dam-client/main.go
       t@@ -174,7 +174,12 @@ func fetchDirlist(locations []string) ([]string, error) {
                lib.CheckError(err)
                for _, i := range nodes {
                        valid, err := lib.RedisCli.HGet(i, "valid").Result()
       -                lib.CheckError(err)
       +                if err != nil {
       +                        // Possible RedisCli bug, possible Redis bug. To be investigated.
       +                        // Sometimes it returns err, but it's nil and does not say what's
       +                        // happening exactly.
       +                        continue
       +                }
                        if valid == "1" {
                                dirSlice = append(dirSlice, i)
                        }
 (DIR) diff --git a/contrib/redis.conf b/contrib/redis.conf
       t@@ -17,4 +17,4 @@ save 60  10000
        rdbcompression yes
        rdbchecksum yes
        
       -stop-writes-on-bgsave-error yes
       +stop-writes-on-bgsave-error no