about summary refs log tree commit diff stats
path: root/svc
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-10 05:09:51 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-11 04:54:43 -0400
commit930ef3459659a7b0353cb98c0de01c18d8cb8570 (patch)
treec9ecf6707ec631ede6bc5195c88167079b38fbdf /svc
parent01956bfa51ff8ccea71843911b4f7c8c21667a67 (diff)
downloadgetwtxt-930ef3459659a7b0353cb98c0de01c18d8cb8570.tar.gz
adding fs sync after db push
Diffstat (limited to 'svc')
-rw-r--r--svc/db.go3
-rw-r--r--svc/go.mod2
2 files changed, 4 insertions, 1 deletions
diff --git a/svc/db.go b/svc/db.go
index ce20ed0..3841d83 100644
--- a/svc/db.go
+++ b/svc/db.go
@@ -4,6 +4,7 @@ import (
 	"time"
 
 	"github.com/syndtr/goleveldb/leveldb"
+	"golang.org/x/sys/unix"
 )
 
 type dbase interface {
@@ -49,6 +50,8 @@ func pushDB() error {
 	err := db.push()
 	dbChan <- db
 
+	unix.Sync()
+
 	return err
 }
 
diff --git a/svc/go.mod b/svc/go.mod
index 78c5d10..a72c819 100644
--- a/svc/go.mod
+++ b/svc/go.mod
@@ -43,7 +43,7 @@ require (
 	golang.org/x/mobile v0.0.0-20190607214518-6fa95d984e88 // indirect
 	golang.org/x/mod v0.1.0 // indirect
 	golang.org/x/net v0.0.0-20190607181551-461777fb6f67 // indirect
-	golang.org/x/sys v0.0.0-20190609082536-301114b31cce // indirect
+	golang.org/x/sys v0.0.0-20190609082536-301114b31cce
 	golang.org/x/tools v0.0.0-20190608022120-eacb66d2a7c3 // indirect
 	google.golang.org/appengine v1.6.1 // indirect
 	google.golang.org/genproto v0.0.0-20190605220351-eb0b1bdb6ae6 // indirect