Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
931 B
2
Indexable
Never
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
Leave a Comment