Похожие чаты

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 ответов

12 просмотров

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

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

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

как правильно удалить сддм? прописал в etc/portage.use/plasma-meta -sddm , но при обновлении юзов мне предлагает поставить lightdm (ещё лучше 😡), добавил туда - display-manage...
REDis
25
#include <stdio.h> #include <stdlib.h> #include <time.h> void mass_first_generate(int mass[5][7]) {     for (int N = 0; N < 5; N++) {         for (int A = 0; A < 7; A++) {   ...
Чувак
6
Except the wealthiest, people that buy crypto want to "cash out" at the end of the day, one way or another. Converting to fiat is craziness, converting to BTC is unwise. Hold ...
Erdelanax
2
Всем привет! Решаю 99 OCaml Problems и столкнулся со следующей проблемой (прошу палками не забивать, я OCaml практически не трогал до этого момента): open OUnit2 let create_...
К|/|pи/\/\ 6е3yглbIи
2
Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
возможно ли как-то передать в электрон или таури медиа поток с рендера 2д движка? двиг запускается как dll, а дальше надо как-то отправлять рендер кодировать не подходит, зр...
Kyle Nekto
7
https://www.linkedin.com/posts/ugama-benedicta-kelechi-codergirl-103041300_mobiledevelopment-fluttertraining-handsonlearning-activity-7263445699227254784-IdHB?utm_source=share...
CoderGirl
16
Hello!!! Moved nodes to another server, but uptime is not transferred. now both servers are working, last time I did the same, only 2 nodes transferred uptime, can you plea...
Kamil
12
VIP-397 BNBx Oracle implementation upgrade Summary This proposal, if approved, will upgrade the implementation of the BNBx Oracle contract on Venus from version 1 (V1) to v...
Venus Announcements
2
like, question: int b = 99999; is this valid and predictable C?
Ludovic 'Archivist' Lagouardette
15
Карта сайта