Похожие чаты

Hello, I have a weird question to ask. I'm facing timing issues

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?

7 ответов

8 просмотров

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?

Christoph- Автор вопроса
A X
Are you tackling exceptions that may be thrown dur...

I havent checked the logs yet, but yes, afaik, exceptions should be handled 🤔

Christoph- Автор вопроса
A X
Are you tackling exceptions that may be thrown dur...

https://github.com/SignorCC/CalendarListBot/blob/master/Program.cs

Christoph
https://github.com/SignorCC/CalendarListBot/blob/m...

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.

Christoph- Автор вопроса
A X
It seems you're polling for updates via the Telegr...

The minute passed should do nothing but send out notifications based on hh:mm

Christoph
The minute passed should do nothing but send out n...

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.

Christoph- Автор вопроса
A X
Hmm, makes sense. You can use BackgroundService f...

Could you point me in the right direction? i've never worked with them before

Похожие вопросы

Обсуждают сегодня

Какой-то там пердун в 90-х решил, что есть какая-то разная типизация. Кого вообще это волнует?
КТ315
49
Hi. Do we have a raid bot? Why nobody doing raids on X? Even RH mentioned this and nobody paying attention...whats the channel for hex memes? If mods cant run raids just insta...
H
31
Подскажите, а есть vault lite или ченить такое?) А то нужен вольт для похода в вольт, но весит он ~500 мб) как-то многовато для парочки запросов ))
Alexandr Orloff
17
блеать, почему так?? где в роутере это исправляется?
Арсен Маньяков 🇦🇲
16
void terminal_scroll() { memmove(terminal_buffer, terminal_buffer + VGA_WIDTH, buffer_size - VGA_WIDTH); memset(terminal_buffer + buffer_size - VGA_WIDTH, 0, VGA_WIDTH); ...
Егор
47
🌊 Ocean Nodes Dashboard Update 🚀 Hey, Oceaners! First off, a massive round of applause 👏to all of you for the amazing engagement since we launched Ocean Nodes. In just a few ...
KreigDK | Never DM first🌊
3
Всем привет! Подскажите, пожалуйста, в чем ошибка? Настраиваю подключение к MySQL. Либы лежат рядом с exe. Все как по "учебнику"
Евгений
16
А можете как-то проверить меня по знаниям по ассемблеру?
A A
132
Здравствуйте! У меня появилась возможность купить книгу "Изучай Haskell во имя добра!". Но я где-то слышал, что эта книга устарела. Насколько это правда??
E
22
люди, которые используют flameshot, к вам вопрос. Можно-ли поставить хоткей на создание скриншота? В программе есть отдел "горячие клавиши", но там все для редактирования, скр...
ThunDer104
11
Карта сайта