Base solution for your next web application
Open Closed

ASPNet Zero persists connection to SQL Azure DB #9082


User avatar
0
andry3ag created

Hi Team,

We have recently download the ASP.Net Core 3x with Anguylar 9.x (version 8.6) and we deployed the DB on Sql Azure. The project is just a web API project and we noticed that it always persists connection to the DB. There seems to be always connection coming from ASP.Net Zero to database eventhough we dont not invoke any API calls. This is causing SQL Server not to pause and it charges even when we do not use the API. Is there anyway to configure the DB not to persist.

Thanks

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    It may be caused by the built-in background workers, you can change their Period appropriately. Or disable them.

    ExpiredAuditLogDeleterWorker(3min)
    SubscriptionExpireEmailNotifierWorker(1 day)
    SubscriptionExpirationCheckWorker(1 hour)
    ``
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    andry3ag created

    Thank you for answer. I have found the files on the project. One last question, how do I disable them all together?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    andry3ag created

    ** Timer.RunOnStart = true; **

    Do I set this to false for all of the 3 classes?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    You can no longer register these background workers.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    marble68 created

    Do we do it in both MVC and Host?

    They are registered in both - or is it if we're only running the API do it there, and if we're doing it in MVC do it there?

    Thanks

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    maliming created
    Support Team

    hi @marble68

    If you will deploy mvc and host projects, you need to change them at the same time.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)