C
C#8mo ago
thecobylot

Help in need to have an opinion about Scheduler -> Email notification

Hello, I need help. Is there a way to modify or create function that will send an email if there is overdue record lets say 1 hour after the record is overdue? I tried creating a scheduler (cron) to run everyminute but it gets expensive and it will always call the database. Is there a way to just simply get all list of records and update the list if there's modified/created record and even i run it every minute atleast it will not just call direct from database?
9 Replies
SpReeD
SpReeD8mo ago
In a short yes. Provided by the little information you gave, like, which database you use, which OS you are referring to (assuming linux as you wrote cron) and absolutly zero sourcecode to modify or work with.
Alen Alex
Alen Alex8mo ago
You could use a scheuling library like Quartz or Hangfire to schedule a Job every 30 mins or 1 hour, and then check from the db and send the email. If you want to go with the cron, the setup something like a console app which will run every 30 min or 1 hour. Also If there are proper indexes on necessary fields the database operation won't be that expensive
thecobylot
thecobylotOP8mo ago
is there a way not to call db every call? azure table storage? is that helpful @Alen Alex
Alen Alex
Alen Alex8mo ago
Really depends upon your implementation, You haven't provided how you are doing it... Also, honestly whats the issue in calling db? It would be better if you actually provide code or some more info...
jcotton42
jcotton428mo ago
why are you averse to querying the database?
thecobylot
thecobylotOP8mo ago
cause im looking at what if it will reach million of records im using .net blazor then sql server
jcotton42
jcotton428mo ago
millions of records is no sweat for a database
thecobylot
thecobylotOP8mo ago
and azure function for my api
Alen Alex
Alen Alex8mo ago
If properly indexed 😁
Want results from more Discord servers?
Add your server