devinus / execjs

Run JavaScript code from Elixir
https://github.com/devinus/execjs
Creative Commons Zero v1.0 Universal
151 stars 22 forks source link

eexist Error #14

Open aruna470 opened 4 years ago

aruna470 commented 4 years ago

I got following error in heavy traffic environment. Reason is System.monotonic_time() time can be same for many requests.

%File.Error{action: "write to file", path: "C:\Users\ARUNAA~1\AppData\Local\Temp/execjs-64712370.js", reason: :eexist}

Issue resolved with following line filename = "execjs-#{hash}-#{Integer.to_string(:rand.uniform(1000000))}.js"

Better if you can provide similar or any other solution with the library itself.