jimpil / duratom

A durable atom type for Clojure
Eclipse Public License 1.0
213 stars 14 forks source link

Fix double string serialization in s3 #1

Closed Igosuki closed 8 years ago

Igosuki commented 8 years ago

Hey dude, the s3 backend serializes the atom twice (the second being in utils/store-to-s3) and so the reader can't read edn afterwards.

Here's a simple fix.

To test it :

echo "{:init true}" > stuff && aws s3 cp stuff s3://mybucket
(defn my-duratom (duratom :aws-s3
                 :credentials {:access-key (env :s3-access-key)
                               :secret-key (env :s3-secret-key)}
                 :bucket "mybucket"
                 :key "stuff"
                 :init {:init true}))

(swap! my-duratom assoc :bla "bla")
aws s3 cp s3://mybucke/stuff cp stuff-r && cat stuff-r
jimpil commented 8 years ago

Hello,

wow, nice catch! I use the local file storage backend extensively and i've used the postgres one a couple of times, but, as you probably figured out i've never used the s3 backend! Many thanks for this - much appreciated :)

Kind regards, Dimitris

Igosuki commented 8 years ago

You're welcome, I'll keep more updates coming if I see anything.