From a0dcb2216d62cec650be0b61ca4641b5d0d64b9c Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Wed, 10 Jul 2019 22:23:57 +0200 Subject: [PATCH] close db handles --- blobs_reflector/reflect.go | 7 +++++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/blobs_reflector/reflect.go b/blobs_reflector/reflect.go index 5a5d35a..744a901 100644 --- a/blobs_reflector/reflect.go +++ b/blobs_reflector/reflect.go @@ -63,6 +63,13 @@ func reflectBlobs() error { if err != nil { return errors.Err(err) } + defer func() { + err := dbHandle.CloseDB() + if err != nil { + log.Errorf("failed to close db handle: %s", err.Error()) + } + + }() st := store.NewDBBackedS3Store( store.NewS3BlobStore(config.AwsID, config.AwsSecret, config.BucketRegion, config.BucketName), dbHandle) diff --git a/go.mod b/go.mod index 46ae4bd..572f31f 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/kr/pretty v0.1.0 // indirect github.com/lbryio/errors.go v0.0.0-20180223142025-ad03d3cc6a5c github.com/lbryio/lbry.go v1.0.15 - github.com/lbryio/reflector.go v1.0.6-0.20190710190215-191671b3cf71 + github.com/lbryio/reflector.go v1.0.6-0.20190710201919-7c7ed9da72ce github.com/lusis/slack-test v0.0.0-20190408224659-6cf59653add2 // indirect github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936 github.com/nikooo777/ytdl v0.0.0-20190215151411-9c7832eaf457 diff --git a/go.sum b/go.sum index dfed172..b8d8247 100644 --- a/go.sum +++ b/go.sum @@ -197,8 +197,8 @@ github.com/lbryio/lbry.go v1.0.15/go.mod h1:JtyI30bU51rm0LZ/po3mQuzf++14OWb6kR/6 github.com/lbryio/lbryschema.go v0.0.0-20190428231007-c54836bca002 h1:urfYK5ElpUrAv90auPLldoVC60LwiGAcY0OE6HJB9KI= github.com/lbryio/lbryschema.go v0.0.0-20190428231007-c54836bca002/go.mod h1:dAzPCBj3CKKWBGYBZxK6tKBP5SCgY2tqd9SnQd/OyKo= github.com/lbryio/ozzo-validation v0.0.0-20170323141101-d1008ad1fd04/go.mod h1:fbG/dzobG8r95KzMwckXiLMHfFjZaBRQqC9hPs2XAQ4= -github.com/lbryio/reflector.go v1.0.6-0.20190710190215-191671b3cf71 h1:mH+Xa6K441w+QJ6u3GVZ+bmlJtm1W7SFhGE6cL6CCbQ= -github.com/lbryio/reflector.go v1.0.6-0.20190710190215-191671b3cf71/go.mod h1:7Y3YYeAKS6egH2WzwfU8f6+uNGjVHfLzKvwn+Nv3VMY= +github.com/lbryio/reflector.go v1.0.6-0.20190710201919-7c7ed9da72ce h1:ixsKssly++rkh0DWxNDrZyiRp00NieKZlndkqtpgj/c= +github.com/lbryio/reflector.go v1.0.6-0.20190710201919-7c7ed9da72ce/go.mod h1:7Y3YYeAKS6egH2WzwfU8f6+uNGjVHfLzKvwn+Nv3VMY= github.com/lbryio/types v0.0.0-20181001180206-594241d24e00/go.mod h1:CG3wsDv5BiVYQd5i1Jp7wGsaVyjZTJshqXeWMVKsISE= github.com/lbryio/types v0.0.0-20190422033210-321fb2abda9c h1:m3O7561xBQ00lfUVayW4c6SnpVbUDQtPUwGcGYSUYQA= github.com/lbryio/types v0.0.0-20190422033210-321fb2abda9c/go.mod h1:CG3wsDv5BiVYQd5i1Jp7wGsaVyjZTJshqXeWMVKsISE=