Update rixxdb

This commit is contained in:
Tobie Morgan Hitchcock 2019-10-08 00:43:39 +01:00
parent f646d47e24
commit 906e600521
5 changed files with 9 additions and 5 deletions

View file

@ -75,7 +75,7 @@ func init() {
startCmd.PersistentFlags().StringVarP(&opts.DB.Code, "key", "k", "", "Encryption key to use for on-disk encryption") startCmd.PersistentFlags().StringVarP(&opts.DB.Code, "key", "k", "", "Encryption key to use for on-disk encryption")
startCmd.PersistentFlags().DurationVar(&opts.DB.Proc.Sync, "db-sync", 0, "A time duration to use when syncing data to persistent storage") startCmd.PersistentFlags().DurationVar(&opts.DB.Proc.Flush, "db-flush", 0, "A time duration to use when syncing data to persistent storage")
startCmd.PersistentFlags().DurationVar(&opts.DB.Proc.Shrink, "db-shrink", 0, "A time duration to use when shrinking data on persistent storage") startCmd.PersistentFlags().DurationVar(&opts.DB.Proc.Shrink, "db-shrink", 0, "A time duration to use when shrinking data on persistent storage")
startCmd.PersistentFlags().StringVar(&opts.DB.Cert.CA, "kvs-ca", "", "Path to the CA file used to connect to the remote database") startCmd.PersistentFlags().StringVar(&opts.DB.Cert.CA, "kvs-ca", "", "Path to the CA file used to connect to the remote database")

View file

@ -29,7 +29,7 @@ type Options struct {
Path string // Path to store the data file Path string // Path to store the data file
Base string // Base key to use in KV stores Base string // Base key to use in KV stores
Proc struct { Proc struct {
Sync time.Duration // Timeframe for syncing data Flush time.Duration // Timeframe for flushing data
Shrink time.Duration // Timeframe for shrinking data Shrink time.Duration // Timeframe for shrinking data
} }
Cert struct { Cert struct {

2
go.mod
View file

@ -6,7 +6,7 @@ require (
github.com/abcum/bump v0.0.0-20190929092354-46a9c9dbf9ab github.com/abcum/bump v0.0.0-20190929092354-46a9c9dbf9ab
github.com/abcum/cork v0.0.0-20190929093632-f45e788b8f1b github.com/abcum/cork v0.0.0-20190929093632-f45e788b8f1b
github.com/abcum/fibre v0.0.0-20191003170635-45f18bd55f9a github.com/abcum/fibre v0.0.0-20191003170635-45f18bd55f9a
github.com/abcum/rixxdb v0.0.0-20191003170549-44f889db956a github.com/abcum/rixxdb v0.0.0-20191007234208-a644cc21c6bd
github.com/abcum/tmpl v0.0.0-20190929092451-4b08f6027ed1 // indirect github.com/abcum/tmpl v0.0.0-20190929092451-4b08f6027ed1 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/elithrar/simple-scrypt v1.3.0 github.com/elithrar/simple-scrypt v1.3.0

2
go.sum
View file

@ -7,6 +7,8 @@ github.com/abcum/fibre v0.0.0-20191003170635-45f18bd55f9a h1:w7vwArRjHlY/Kvi4f86
github.com/abcum/fibre v0.0.0-20191003170635-45f18bd55f9a/go.mod h1:CPo8U5dmWBEajd6U7ozAQRp0b1zbuRkaAyZJneBZ63g= github.com/abcum/fibre v0.0.0-20191003170635-45f18bd55f9a/go.mod h1:CPo8U5dmWBEajd6U7ozAQRp0b1zbuRkaAyZJneBZ63g=
github.com/abcum/rixxdb v0.0.0-20191003170549-44f889db956a h1:J/GpT8OmcVuKW+SBYMRx+pZrjaFIUQlBRTx7I07bk84= github.com/abcum/rixxdb v0.0.0-20191003170549-44f889db956a h1:J/GpT8OmcVuKW+SBYMRx+pZrjaFIUQlBRTx7I07bk84=
github.com/abcum/rixxdb v0.0.0-20191003170549-44f889db956a/go.mod h1:6lIALuvT453ADA/5AFRXGLDNcc3sqIvt4ISaKyPeTLg= github.com/abcum/rixxdb v0.0.0-20191003170549-44f889db956a/go.mod h1:6lIALuvT453ADA/5AFRXGLDNcc3sqIvt4ISaKyPeTLg=
github.com/abcum/rixxdb v0.0.0-20191007234208-a644cc21c6bd h1:H3T4nMRicB2kVgkmgXbvqAecczHm5397FpYgm24/c8o=
github.com/abcum/rixxdb v0.0.0-20191007234208-a644cc21c6bd/go.mod h1:6lIALuvT453ADA/5AFRXGLDNcc3sqIvt4ISaKyPeTLg=
github.com/abcum/tmpl v0.0.0-20190929092451-4b08f6027ed1 h1:hRp2bOK7p4HTCCFl4v0apR309NuN1qpKnWnX21JSCHQ= github.com/abcum/tmpl v0.0.0-20190929092451-4b08f6027ed1 h1:hRp2bOK7p4HTCCFl4v0apR309NuN1qpKnWnX21JSCHQ=
github.com/abcum/tmpl v0.0.0-20190929092451-4b08f6027ed1/go.mod h1:T/xXRVJ6YMMHqf+MiKW6KELsEmb2n4eNMsaNQ6lI5M8= github.com/abcum/tmpl v0.0.0-20190929092451-4b08f6027ed1/go.mod h1:T/xXRVJ6YMMHqf+MiKW6KELsEmb2n4eNMsaNQ6lI5M8=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=

View file

@ -28,14 +28,16 @@ func init() {
var pntr *rixxdb.DB var pntr *rixxdb.DB
pntr, err = rixxdb.Open(opts.DB.Path, &rixxdb.Config{ pntr, err = rixxdb.Open(opts.DB.Path, &rixxdb.Config{
// Explicitly sync writes
SyncWrites: true,
// Set the encryption key // Set the encryption key
EncryptionKey: opts.DB.Key, EncryptionKey: opts.DB.Key,
// Set the sync offset duration // Set the sync offset duration
SyncPolicy: opts.DB.Proc.Sync, FlushPolicy: opts.DB.Proc.Flush,
// Set the shrink offset duration // Set the shrink offset duration
ShrinkPolicy: opts.DB.Proc.Shrink, ShrinkPolicy: opts.DB.Proc.Shrink,
// Don't wait for syncing if shrinking // Don't wait for syncing if shrinking
IgnoreSyncPolicyWhenShrinking: true, IgnorePolicyWhenShrinking: true,
}) })
if err != nil { if err != nil {