BirthdayBot/BackgroundServices
Noi 021def4f88 Fix roles not updating
Accidentally rewrote a handful of things while I was at it. The changes are staying.

After a long search, I found that this issue only shows itself if the bot is in several servers, encountering a valid configuration while it has yet to look at more servers (that is, a situation my debug bot is not in). The loop had been quitting halfway through for reasons seemingly beyond any logic or comprehension.

I already had a hunch that the query I wrote earlier was needlessly complex, as one might expect considering it was written during a state of delirium. It was easy to simplify it. I hoped that would be it, but no change occurred. On the contrary, some checks I slipped in there in the meantime were *passing*.

Further and further investigation finally revealed that the exception handler for background services doesn't actually do what it's expected to do. It's been silently dropping the exceptions that EF had been throwing this whole time, telling me quite plainly what the problem was and why it was quitting at a seemingly random spot.

The fix: Turns out the query evaluates during the foreach loop, which conflicts with wanting to do additional queries within it. Throwing a ToList() somewhere in it seems to have solved it.

These last few hours were quite the adventure...
My head hurts. Now I'm off to take a look at the exception handler.
2022-03-21 23:52:36 -07:00
..
AutoUserDownload.cs Add log message 2022-03-21 23:33:24 -07:00
BackgroundService.cs Update services to use EF queries 2022-03-21 12:12:18 -07:00
BirthdayRoleUpdate.cs Fix roles not updating 2022-03-21 23:52:36 -07:00
DataRetention.cs Update services to use EF queries 2022-03-21 12:12:18 -07:00
ExternalStatisticsReporting.cs Update services to use EF queries 2022-03-21 12:12:18 -07:00
ShardBackgroundWorker.cs Various changes 2021-12-05 18:58:10 -08:00