From 92b31bc2c5aba96255dc5e760f20acd88826a4ee Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 23 Jan 2022 23:57:26 -0500 Subject: [PATCH] this nonsense helps my poor ADHD --- .../threads/twitch_pubsub_user_subscriber_thread.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/service/obs_gateway/src/threads/twitch_pubsub_user_subscriber_thread.rs b/crates/service/obs_gateway/src/threads/twitch_pubsub_user_subscriber_thread.rs index 59b2cab9ae..b5ed3cc1ad 100644 --- a/crates/service/obs_gateway/src/threads/twitch_pubsub_user_subscriber_thread.rs +++ b/crates/service/obs_gateway/src/threads/twitch_pubsub_user_subscriber_thread.rs @@ -35,6 +35,10 @@ use database_queries::twitch_oauth::insert::TwitchOauthTokenInsertBuilder; // TODO: Error handling, handle disconnects. // TODO: (cleanup) make the logic clearer to follow. +// ========================================= +// =============== STAGE ONE =============== +// ========================================= + pub struct TwitchPubsubUserSubscriberThread { thread_id: ThreadId, server_hostname: String, @@ -143,6 +147,10 @@ impl TwitchPubsubUserSubscriberThread { } } +// ========================================= +// =============== STAGE TWO =============== +// ========================================= + /// The thread is somewhat of a state machine. /// The first stage of thread startup can end prematurely, which is why /// this is modeled as two different structs. @@ -441,6 +449,10 @@ impl TwitchPubsubUserSubscriberThreadStageTwo { } } +// ==================================== +// =============== MISC =============== +// ==================================== + async fn lookup_oauth_record( twitch_user_id: &TwitchUserId, mysql_pool: &sqlx::Pool