private async Task HandleTweet(DB.TweetsContext tweetsDB, DB.Tweet tweet) { try { var t = await tweetsDB.AddTweetWithCheckAsync(tweet); if (t == null) { logger.LogDebug($"Duplicate - id: {tweet.ID}"); return; } logger.LogDebug($"Tweet added - id: {t.Entity.ID} @{t.Entity.Location}"); } catch (Exception e) { logger.LogError(e, "Error during background tweet handling"); } }
public TweetsController(DB.TweetsContext context) { _context = context; }