attempts to get the query and retry if it cannot
(query_id: int, session: Session)
| 129 | max_tries=5, |
| 130 | ) |
| 131 | def get_query(query_id: int, session: Session) -> Query: |
| 132 | """attempts to get the query and retry if it cannot""" |
| 133 | try: |
| 134 | return session.query(Query).filter_by(id=query_id).one() |
| 135 | except Exception as ex: |
| 136 | raise SqlLabException("Failed at getting query") from ex |
| 137 | |
| 138 | |
| 139 | @celery_app.task( |
no test coverage detected