We use Python Wand under Celery to process a lot of pictures. On some of our servers, our treatment sometimes leaves a lot of temporary files behind, e.g.:
$ ls -lh /tmp/
-rw------- 1 ubuntu ubuntu 1.9M Apr 1 04:35 magick-y1yKKiVZ
-rw------- 1 ubuntu ubuntu 1.9M Apr 1 04:41 magick-Y22P6McK
-rw------- 1 ubuntu ubuntu 1.9M Apr 1 04:37 magick-YaaSIYrk
-rw------- 1 ubuntu ubuntu 1.9M Apr 1 04:39 magick-YEkn4H15
-rw------- 1 ubuntu ubuntu 1.9M Apr 1 04:39 magick-yf2Vrfwi
-rw------- 1 ubuntu ubuntu 1.9M Apr 1 04:38 magick-YIYTaArn
-rw------- 1 ubuntu ubuntu 199K Apr 1 04:43 magick-YLM5wYm9
-rw------- 1 ubuntu ubuntu 199K Apr 1 04:43 magick-YLo5SeVp
[...]
Is there a way to make Wand clean up after it worked on some file? If it's the expected behavior, is there a way to debug this and know which image created which temp file, by putting a log statement for example?
Thanks