More transparent writes
This commit is contained in:
parent
efc2a306ef
commit
51bc5b04e1
18
storage.go
18
storage.go
@ -26,14 +26,16 @@ func SetupStorage() {
|
|||||||
|
|
||||||
func PersistMessages() {
|
func PersistMessages() {
|
||||||
for {
|
for {
|
||||||
payload := <-saver
|
p := <-saver
|
||||||
i := payload.Queue.Counter.Write + 1
|
|
||||||
key := NewKey(payload.Queue.Name, i)
|
|
||||||
|
|
||||||
if err := storage.Set(key, payload.Message); err != nil {
|
p.Queue.Counter.Write(func(i uint) bool {
|
||||||
rollbar.Error("error", err)
|
key := NewKey(p.Queue.Name, i)
|
||||||
} else {
|
err := storage.Set(key, p.Message)
|
||||||
payload.Queue.Counter.Incr()
|
if err != nil {
|
||||||
}
|
Error(err, "Failed to write %d bytes to record '%s'", len(p.Message), key)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (err != nil)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user