Untitled

 avatar
unknown
plain_text
a year ago
931 B
5
Indexable
def get_existing_status_summary(self):
    queue_result = self.db.execute_dql_query(
        f"SELECT COUNT(*)"
        f" FROM {WORKFLOW_TABLE_NAME}"
        f" WHERE {WORKFLOW_COLUMNS['status'][0]} = 'QUEUE';"
    )['results'][0][0]

    scheduled_result = self.db.execute_dql_query(
        f"SELECT COUNT(*)"
        f" FROM {WORKFLOW_TABLE_NAME}"
        f" WHERE {WORKFLOW_COLUMNS['status'][0]} = 'SCHEDULED';"
    )['results'][0][0]

    starting_result = self.db.execute_dql_query(
        f"SELECT COUNT(*)"
        f" FROM {WORKFLOW_TABLE_NAME}"
        f" WHERE {WORKFLOW_COLUMNS['status'][0]} = 'STARTING';"
    )['results'][0][0]

    in_progress_result = self.db.execute_dql_query(
        f"SELECT COUNT(*)"
        f" FROM {WORKFLOW_TABLE_NAME}"
        f" WHERE {WORKFLOW_COLUMNS['status'][0]} = 'IN_PROGRESS';"
    )['results'][0][0]

    return queue_result, scheduled_result, starting_result, in_progress_result
Editor is loading...
Leave a Comment