Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Store-native TTL management #34

Merged
merged 12 commits into from
Sep 20, 2018
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@
},
{
"author": "magik6k",
"hash": "QmUCfrikzKVGAfpE31RPwPd32fu1DYxSG7HTGCadba5Wza",
"hash": "QmaiEBFgkgB1wjrPRxru5PyXPEkx58WuMjXNaR1Q9QNRjn",
"name": "go-ds-badger",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depending on badger directly this far down is a bit weird. Especially since its not something we are tied to at this point (and may move away from)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just used in tests to create test instances -- not in production code. Any other way you can think of?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Java, this dependency would be in test scope in maven or gradle. No such thing in Go / gx AFAIK.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a gx thing. go get by default won't download test dependency packages. The -t flag is required to download test deps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How difficult would it be to add basic ttl support to the in-memory datastore. It doesn't have to be fancy, it could literally be a:

  1. Check on read.
  2. Sweep every N minutes.

Copy link
Member Author

@raulk raulk Sep 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the datastore not the peerstore, right? It would be pretty straightforward, I'll work on it!

Eventually (when KeyBook and PeerMetadata are migrated to use the datastore), it may make sense to remove the in-memory implementation of the peerstore, and have the constructor delegate to a map-based datastore peerstore.

That's almost a tongue twister!

"version": "1.6.1"
"version": "1.7.0"
},
{
"hash": "QmSpg1CvpXQQow5ernt1gNBXaXV6yxyNqi7XoeerWfzB5w",
"hash": "QmUyz7JTJzgegC6tiJrfby3mPhzcdswVtG4x58TQ6pq8jV",
"name": "go-datastore",
"version": "3.1.0"
"version": "3.2.0"
},
{
"hash": "QmQjMHF8ptRgx4E57UFMiT4YM6kqaJeYxZ1MCDX23aw4rK",
Expand Down
Loading