1
0
Fork 0

Don't try delete records that failed to read

This commit is contained in:
Gregory Eremin 2014-07-16 02:53:15 +07:00
parent dadbcfd0f1
commit 00e4b4c82a
1 changed files with 3 additions and 1 deletions

View File

@ -34,14 +34,16 @@ func (q *Queue) Fetch() (Message, bool) {
msg, err := storage.Get(key)
if err != nil {
Error(err, "Failed to read record '%s'", key)
return msg, false
}
err = storage.Remove(key)
if err != nil {
Error(err, "Failed to delete record '%s'", key)
return msg, false
}
return msg, (err == nil)
return msg, true
}
func GetQueue(name string) *Queue {