loading images from tempfile

0 views
Skip to first unread message

malikb

unread,
Jun 30, 2009, 2:37:43 PM6/30/09
to Paperclip Plugin
I have a collision of image versions when I try to imitate "virtual"
uploading from a temporary file;
http://pastie.org/529718

It downloads image from the web using open-uri; and downloaded picture
is stored in a tempfile.

When two or more people (or OS processes) start downloading at the
same time, image has a collisions of styles
(e.g. :original, :thumbnail)... I got a thumbnail of previos
downloaded image, or next image will have a thumbnail which is
generated from the current downloaded image.

Lee Hambley

unread,
Jun 30, 2009, 3:21:04 PM6/30/09
to papercli...@googlegroups.com
You need to research making your instance variables thread safe, this problem is upstream of Paperclip in your app that is threading/forking I suspect.


If you're already just running multiple copies of your script, and not threading/forking - we may have a more serious problem to address.

- Lee

2009/6/30 malikb <mali...@gmail.com>
Reply all
Reply to author
Forward
0 new messages