private static void RegisterThreads() { var concurrentQueue = new ConcurrentQueue <PostRecord>(); var reddit = new Reddit(); //var subredditNames = new List<string>(); var sb = new StringBuilder(); using (MassTaggerContext context = new MassTaggerContext()) { foreach (var subreddit in context.Subreddits) { sb.Append(subreddit.SubName + "+"); } } try { var sub = sb.ToString().Substring(0, sb.ToString().Length - 1); var subreddit = reddit.GetCombinedSubreddit(sub); if (subreddit != null) { void commentStart() => MakeCommentListener(subreddit, concurrentQueue); void postStart() => MakePostListener(subreddit, concurrentQueue); var commentThread = new Thread(commentStart); var postThread = new Thread(postStart); commentThread.Start(); postThread.Start(); } } catch (Exception e) { } void addRecords() => AddRecords(concurrentQueue); var addThread = new Thread(addRecords); addThread.Start(); }