has anyone ran into any issues when using lein ring and mount with swapped states? I'm having difficulty using lein ring's reload features. Whenever a file is changed it runs that respective file's tests during reload, calls mounts swaps, and subsequently removes the original mounted state. Is there a way to avoid this?
@dbernal That sounds like just a factor of how Mount works since it relies on global mutable state. It's why a lot of people prefer something like Component.
Hello. I'm trying to implement file upload with a progress reporter. I am using ring.middleware.multipart-params
https://ring-clojure.github.io/ring/ring.middleware.multipart-params.html
Before the upload actually starts transferring data, I need to do some other stuff, namely give the upload an identifier, save that to a database, and add the identifier to the request so it can be included with the progress events dispatched to clients
I am able to write my own :store
function, where I have access to the java.io.InputStream
, but I do not have access to the request
I am able to write my own :progress-fn
where I have access to the request, but I do not know how to add an upload-id to the request before it gets there
I mean, if I can just add some arbitrary data to the request before it hits :progress-fn
, that should be enough
Before I wanted to add upload progress, I just made my route like this (POST "/room/:room-id/upload" req (upload/upload (add-upload-id req))))
and upload/upload
would get the request and the uploaded file
but not until after the upload was complete