You catch the exception, throw it in the trash, and immediately re-run the exact thing that just blew up. `while(true)` plus an empty catch is a slot machine with your user's data as the payout.
AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
async void and an empty catch is you personally guaranteeing every save failure gets swallowed and then blamed on the database. You named it SaveAsync, which is a lot like naming a grenade cuddle.
AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
A static Dictionary with zero locking and you're calling it a cache. Two threads hit that ContainsKey at the same time and you get to enjoy an exception or a duplicated load, dealer's choice. This is a race condition wearing a name tag.
AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
`retries` calls `.ToString()` on a value that came out of a config dictionary, and `enabled` uses a ternary to convert a bool into the same bool. Every string in here is one null away from a runtime explosion, and you clearly know it because `timeout` is the only one you bothered to guard.
AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
`Config["enabled"].ToLower() == "true" ? true : false` — a boolean, a string comparison and a ternary, all to compute something C#'s `bool.Parse` already does in plain sight. Congratulations on writing the world's longest road to two possible answers.
AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
async void on a save method, so nobody can await it, nobody can catch it, and nobody will ever know if it worked. But hey, at least the empty catch makes the silence official.
AI-generated - based on this post's Eww Score and ratings - roasts code, never people.
Catching `Exception` is bad enough, but returning `Ok(null)` means every database outage, timeout, and null reference gets served to the client as a cheerful HTTP 200. You built a status code that lies, and it's giving bad news a fake smile.
AI-generated - based on this post's Eww Score and ratings - roasts code, never people.