0

I have a polling service that makes continuous http requests to Microsoft Graph APIs(/me/events), every 1 minute.

The application is made like a dotnet core web app and hosted on Azure. I have also mapped application insights to it for logging.

However, at times the timer abruptly stops giving me no exception.

I am using System.Timers class to keep a non-static infinite timer.

Kindly suggest a better/best way to implement this in dotnet as I am new to the language and still learning.

Thank you for taking out time to answer this.

Regards, Aarushi

MMA
  • 41
  • 5
  • I would suggest you to give a try using Events delta (refer the below documentation) to get the incremental changes for the events. This allows you to maintain and synchronize a local store of a user's events in the primary calendar, without having to fetch all the events of that calendar from the server every time. https://learn.microsoft.com/en-us/graph/api/event-delta?view=graph-rest-1.0&tabs=http – Dev Sep 18 '20 at 18:11
  • You can use a job scheduler as described in this [post](https://stackoverflow.com/questions/63722040/delaying-a-task-in-c-sharp-db-context-disposed/63722204#63722204) – Preben Huybrechts Sep 18 '20 at 19:19

1 Answers1

1

I would suggest you to give a try using Events delta (refer the below documentation) to get the incremental changes for the events. This allows you to maintain and synchronize a local store of a user's events in the primary calendar, without having to fetch all the events of that calendar from the server every time. Documentation Link

Dev
  • 2,428
  • 2
  • 14
  • 15