Curious @Kurisu, do you have a bit more context around this issue? Are you only trying to run a Task in production? I think having a bit more detail / context around your problem could even help people who are answering the question.
In general, in most Elixir codebases (at least the ones I’ve seen), people tend to set environment specific config values (e.g., for API keys - sandbox and production) when the environment makes a difference rather than calling Mix.env directly.
Here the context… In dev environment I configured Arc uploader to store pictures on local disk, but in production on a storage like Amazon S3. So to delete a file in dev mode, I’m using « File.rm_rf!/1 » but this won’t work wiith S3 (I will use Arc deleting funtion for this case).
Thank you. I did well by asking the question then. ^^
Maybe… I just found it easier some times ago to delete the files from the local disk with my own function when in dev environment…
I will try again the Arc delete function in dev with local storage and if it works as expected, then good!
I feel like I’m proposing an immediate solution to other people’s immediate problems. They can use it until, as you suggested above, arc fixes this “bug”. And, as always, other users are free to suggest more idiomatic approaches if they don’t agree with me. There is zero reason to not be happy about it.
It’s good to know I can even do something like that! ^^
I understand too, the way I should use configs…
Finally I have to say that Arc function for files deletion works. I just have not to store files in subfolders because Arc would let plenty empty folders after deletion. I was using subfolders so I can delete all versions of a picture by deleting a subfolder, but Arc delete them one by one and let an empty subfolder.