while using .NET in a Docker Container:
An async method is called every full minute using a timer. However it happens that unpredictably, the method is sometimes called twice in the course of a minute and today, for the first time in 2 months, not at all 🤔
The code is running 24/7, does anybody have a clue if timing can be inaccurate in docker on vServers?
Are you tackling exceptions that may be thrown during the running of such a method? If an exception gets thrown, your periodic execution can stop too depending on how you've written the code. Also, are you using BackgtoundServicd for running this method periodically?
I havent checked the logs yet, but yes, afaik, exceptions should be handled 🤔
https://github.com/SignorCC/CalendarListBot/blob/master/Program.cs
It seems you're polling for updates via the Telegram Bot API. I wouldn't put semaphores and async/await in the same construct. There are much better ways of handling your expected usecase.
The minute passed should do nothing but send out notifications based on hh:mm
Hmm, makes sense. You can use BackgroundService for this. Perfect fit and it'll only be running as a single instance. Avoid using semaphores in this context.
Could you point me in the right direction? i've never worked with them before
Обсуждают сегодня