Base solution for your next web application
Open Closed

Background Worker Processes not getting updated Settings Values #9678


User avatar
0
rucksackdigital created

Hello,

  • V7.3.1
  • MVC
  • .NET Core

I'm running into an issue with my background workers; I have a job set up to run every 5 minutes, which calls a domain service to process some data. My domain service is calling await SettingManager.GetSettingValueForApplicationAsync() to retrieve a application-level setting value.

What seems to be happening is, when I change this value through the web interface, my domain service still receives the old value. I have tried going through maintenance to flush the caches manually, but the old value is still received until I shutdown and restart the application in IIS.

Has anyone run into an issue similar to this?


4 Answer(s)
  • User Avatar
    0
    zony created
    Support Team

    Hi rucksackdigital, Does the corresponding setting item take effect in the database?

  • User Avatar
    0
    rucksackdigital created

    @Zony, thanks for your reply. Yes, they do. I see them immediately in the database and also via an application service reading the same values.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @rucksackdigital

    Settings are cached in memory by default. Since you have two different apps accessing the settings, they are using different in memory caches.

    I suggest you to use Redis for your both app's caching, see https://aspnetboilerplate.com/Pages/Documents/Caching#redis-cache-integration

  • User Avatar
    0
    rucksackdigital created

    D'oh! Can't believe I didn't think of that; you're 100% correct, thanks for a great product and great support, @ismcagdas