ソースを参照

Merge pull request #583 from aboch/bq

Fix in bitseq.NewHandle()
Jana Radhakrishnan 9 年 前
コミット
fa47cb8da2
1 ファイル変更7 行追加0 行削除
  1. 7 0
      libnetwork/bitseq/sequence.go

+ 7 - 0
libnetwork/bitseq/sequence.go

@@ -65,6 +65,13 @@ func NewHandle(app string, ds datastore.DataStore, id string, numElements uint32
 		return nil, err
 		return nil, err
 	}
 	}
 
 
+	// If the handle is not in store, write it.
+	if !h.Exists() {
+		if err := h.writeToStore(); err != nil {
+			return nil, fmt.Errorf("failed to write bitsequence to store: %v", err)
+		}
+	}
+
 	return h, nil
 	return h, nil
 }
 }