aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--models/persister.go10
-rwxr-xr-xsample-cgi-handler.sh2
2 files changed, 6 insertions, 6 deletions
diff --git a/models/persister.go b/models/persister.go
index 60c25b5..4381008 100644
--- a/models/persister.go
+++ b/models/persister.go
@@ -22,20 +22,20 @@ func NewPersister(log *zap.SugaredLogger, db *badger.DB) *Persister {
}
func (p *Persister) Store(model model) error {
- log := p.log.With("model", model.Name())
- log.Debug("store")
+ log := p.log.With("model", model.Name()).With("DedupKey", model.DedupKey()).With("Key", model.Key())
+ log.Debug("Store()")
err := p.db.View(func(txn *badger.Txn) error {
var getErr error
var updateErr error
- log.With("DedupKey", model.DedupKey()).Debug("checking")
+ log.Debug("checking")
_, getErr = txn.Get([]byte(model.DedupKey()))
if getErr == badger.ErrKeyNotFound {
- log.With("DedupKey", model.DedupKey()).Debug("not found")
+ log.Debug("not found")
updateErr = p.db.Update(model.Save) // stores the outbox item
if updateErr != nil {
return updateErr
}
- log.With("DedupKey", model.DedupKey()).Debug("saving")
+ log.Debug("saving")
updateErr = p.db.Update(model.SaveDedup) // stores the sha256
}
return updateErr
diff --git a/sample-cgi-handler.sh b/sample-cgi-handler.sh
index b9b195d..bc82dc4 100755
--- a/sample-cgi-handler.sh
+++ b/sample-cgi-handler.sh
@@ -3,7 +3,7 @@ echo "Content-type: application/atom+xml"
echo ""
echo '<feed xmlns="http://www.w3.org/2005/Atom">
<entry>
- <content>asd</content>
+ <content>alkfjlasjf</content>
</entry>
</feed>'
exit 0