QueueClassic / queue_classic

Simple, efficient worker queue for Ruby & PostgreSQL.
MIT License
1.19k stars 152 forks source link

check that the connection is still able to make queries #301

Closed fattymiller closed 5 years ago

fattymiller commented 5 years ago

Before making requests against the QC::Queue::conn_adapter, check that we are not in an errored state.

We can do this by checking that the connection has not finished, and also checking that we are not in an error/unknown state.

If the connection is no longer active, wipe and refresh the memoized version.

ukd1 commented 5 years ago

@fattymiller do you have time to work on any of these review comments?

fattymiller commented 5 years ago

@ukd1 hey sorry - we found a different way of handling the issues around this in our project, and can't remember the use case I was testing.

Free free to either add to this PR, or close it in favour of another one.

After raising PR, I seem to remember finding another place or two where a connection was memoized, and thinking that we could either move some of this logic up a level, or add code to invalidate those as well.

ukd1 commented 5 years ago

@fattymiller thanks! I'm going to close it for now.