miracle2k / webassets

Asset management for Python web development.
BSD 2-Clause "Simplified" License
921 stars 258 forks source link

Lock on building bundles with the same output target #515

Open SpeedProg opened 5 years ago

SpeedProg commented 5 years ago

I ran into problems with the autobuild starting the build progress so often that the server ran out of memory (from all the node instances). So here is my solution to preventing this from happening

miracle2k commented 5 years ago

Thanks for the PR. I think a locking system is a sensible improvement for this case, but I think this is incomplete as-is. It would only work when using a threaded model, but not if the workers are forked. To handle multiple processes competing, the lock has to be filesystem based, really; a threading lock is not enough.