diff --git a/global_objects/admin_queries.py b/global_objects/admin_queries.py index cc34ab9d..803b76bd 100644 --- a/global_objects/admin_queries.py +++ b/global_objects/admin_queries.py @@ -74,7 +74,9 @@ def __get_template_usage(organization_id: str = "", as_query: bool = False): INNER JOIN organization o ON st.organization_id = o.id {org_where} - group BY 1""" + group BY 1 + ORDER BY 1 + """ if as_query: return query return general.execute_all(query) @@ -1098,6 +1100,7 @@ def __get_users_by_org( ON u.organization_id = o.id {where_add} GROUP BY 1,2 + ORDER BY 1,2 """ if as_query: return query diff --git a/session.py b/session.py index 4ea47ac5..034a8771 100644 --- a/session.py +++ b/session.py @@ -101,7 +101,7 @@ def start_session_cleanup_thread(): def __start_session_cleanup(): while True: with session_lock: - sessions = general.get_session_lookup(exclude_last_x_seconds=20 * 60) + sessions = general.get_session_lookup(exclude_last_x_seconds=30 * 60) for session in sessions: try: general.force_remove_and_refresh_session_by_id(