Browse Source

fixed race condition that would result in a document update conflict if a user url was requested multiple times before the request was allowed to complete

master
Wesley Kerfoot 12 years ago
parent
commit
5c04023931
  1. 5
      cacher.rkt

5
cacher.rkt

@ -52,8 +52,9 @@
(hash-set! message '_id username)
(hash-set! message (string->symbol page-num) data)
(hash-set! message 'last_updated (current-inexact-milliseconds))
(couchdb-put conn message)
data))
(with-handlers ([exn:couchdb:conflict? (λ(x) data)])
(couchdb-put conn message)
data)))
;; Checks if a document needs updating
;; Info -> String