aboutsummaryrefslogtreecommitdiff
path: root/yamldb
diff options
context:
space:
mode:
Diffstat (limited to 'yamldb')
-rw-r--r--yamldb/yamldb.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/yamldb/yamldb.go b/yamldb/yamldb.go
index 1478cc7..76a8292 100644
--- a/yamldb/yamldb.go
+++ b/yamldb/yamldb.go
@@ -30,13 +30,16 @@ func (db *YamlDB) Transaction(callback func() bool, marshaller func() ([]byte, e
if isDataChanged {
yamlData, err := marshaller()
+ log.Debugf("Marshalled YAML: %#v", string(yamlData))
if err != nil {
return errors.Wrap(err, "Data marshalling error")
}
+
err = ioutil.WriteFile(db.PathNew, yamlData, 0644)
if err != nil {
return errors.Wrap(err, "YamlDB write failure")
}
+
err = os.Rename(db.PathNew, db.Path)
if err != nil {
return errors.Wrap(err, "Couldn't rewrite an old YamlDB file")