honeydew
honeydew copied to clipboard
Add a documented way to select finished ecto queue jobs
I want to select all items that have been successfully processed by honeydew, I guessed by looking at the source code that I can use where([x], is_nil(x.honeydew_whatever_lock))
to do this, but this couples my code tightly against honeydew implementation details, I'd like a more "official" or "public" way to achieve this.
https://github.com/koudelka/honeydew/blob/b60b639d6b2b3253f1bb20246df48ab54e6858ae/lib/honeydew/sources/ecto_source.ex#L8-L14
A documented way to select jobs in a different state would be nice too, but this is not something I'm struggling with currently.
Hey there. :)
What's your ideal API look like for this? An SQL fragment, or a function that adds a where
clause to an Ecto query maybe?
Maybe a macro you can use in a where
clause?
query
|> where([x], honeydew_is_finished(x, :classify_photos) and x.enabled == true)
It could expand into a right fragment.