New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add /queued/ API #42
Add /queued/ API #42
Conversation
run_names = set([item[0] for item in query if item[0]]) | ||
runs = Run.query.filter(Run.name.in_(sorted(run_names))).order_by( | ||
Run.scheduled) | ||
return runs.all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we ever going to have the possibility of a gazillion jobs queued? because then this would become really expensive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh you're right. Let me see if I can find a faster way. I think I was overcaffeinated yesterday and entered the dreaded "just make it work" mode.
Returns a list of runs that have any queued jobs Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
@@ -3,7 +3,7 @@ | |||
from sqlalchemy import Date, cast | |||
|
|||
from pecan import abort, conf, expose, request | |||
from paddles.models import Run, rollback | |||
from paddles.models import Job, Run, rollback, Session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not specific to this changeset, but rollback
is not being used correctly in this module. I opened http://tracker.ceph.com/issues/9010 so this can be tracked and fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put those rollbacks there when I was constantly hitting deadlocks whose exceptions specifically told me the transaction needed to be rolled back. It may be safe to remove them now, but I'm not doing it in this PR...
Returns a list of runs that have any queued jobs
Signed-off-by: Zack Cerza zack.cerza@inktank.com