Conversation
Signed-off-by: Sander Pick <sanderpick@gmail.com>
Signed-off-by: Sander Pick <sanderpick@gmail.com>
Signed-off-by: Sander Pick <sanderpick@gmail.com>
jsign
left a comment
There was a problem hiding this comment.
LGTM. Left some comments to think about.
| /usr/bin/mongod --fork --logpath /var/log/mongod.log --bind_ip_all --replSet rs0 | ||
| mongo --eval 'rs.initiate({_id: "rs0", version: 1, members: [{ _id: 0, host: "mongo:27017" }]})' | ||
| tail -f /var/log/mongod.log |
There was a problem hiding this comment.
Cool, what we chated in the other PR. 👍🏼
There was a problem hiding this comment.
Yep, I added a little test util package in go-ds-mongo... makes it easy to start the replica set for tests: https://github.com/textileio/go-ds-mongo/blob/master/mongo_test.go#L20
threadsd/main.go
Outdated
| keepAliveInterval := fs.Duration("keepAliveInterval", time.Second*5, "Websocket keepalive interval (must be >= 1s)") | ||
| enableNetPubsub := fs.Bool("enableNetPubsub", false, "Enables thread networking over libp2p pubsub") | ||
| mongoUri := fs.String("mongoUri", "", "MongoDB URI (if not provided, an embedded Badger datastore will be used)") | ||
| mongoDatabase := fs.String("mongoDatabase", "threaddb", "MongoDB database name") |
There was a problem hiding this comment.
I think is safer to not provide a default value, and error on startup if this isn't set explicitly through flag/env.
I fear that not providing a value might overlap with multiple instances running in the same cluster, which might be dangerous.
That's what I did in Powergate simply to avoid a misconfiguration (or simply doing nothing using defaults) that might cause a really bad situation.
There was a problem hiding this comment.
Cool, default removed
Signed-off-by: Sander Pick <sanderpick@gmail.com>
Signed-off-by: Sander Pick <sanderpick@gmail.com>
Allows the use of
go-ds-mongofor all needed persistence.