From 930ef3459659a7b0353cb98c0de01c18d8cb8570 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Mon, 10 Jun 2019 05:09:51 -0400 Subject: adding fs sync after db push --- svc/db.go | 3 +++ svc/go.mod | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'svc') 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 -- cgit 1.4.1-2-gfad0