MCPcopy
hub / github.com/dgraph-io/dgraph / StoreSync

Function StoreSync

x/x.go:1243–1259  ·  view source on GitHub ↗
(db DB, closer *z.Closer)

Source from the content-addressed store, hash-verified

1241}
1242
1243func StoreSync(db DB, closer *z.Closer) {
1244 defer closer.Done()
1245 // We technically don't need to call this due to mmap being able to survive process crashes.
1246 // But, once a minute is infrequent enough that we won't lose any performance due to this.
1247 ticker := time.Tick(time.Minute)
1248
1249 for {
1250 select {
1251 case <-ticker:
1252 if err := db.Sync(); err != nil {
1253 glog.Errorf("Error while calling db sync: %+v", err)
1254 }
1255 case <-closer.HasBeenClosed():
1256 return
1257 }
1258 }
1259}
1260
1261// DeepCopyJsonMap returns a deep copy of the input map `m`.
1262// `m` is supposed to be a map similar to the ones produced as a result of json unmarshalling. i.e.,

Callers 2

RunMethod · 0.92
RunMethod · 0.92

Calls 3

SyncMethod · 0.65
DoneMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected