cofoundry-cms / cofoundry

Cofoundry is an extensible and flexible .NET Core CMS & application framework focusing on code first development

Home Page:https://www.cofoundry.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to stop auto update in production

HardikFefar opened this issue · comments

when we run application a few times in local and then suddenly, there is this message "The site is being updated. Please try again shortly." and app is not working for a while.

is there a way we can stop those auto update or they are not meant to be stopped at all?
we can run them manually when there is no traffic in the site though if needed

This is the distributed locking mechanism that prevents multiple concurrent auto-update processes running. It will also prevents the applicartion from running if there is an error applying the update, however if this was the case you would see an error message when running in development mode.

If you are seeing this message for an extended period, it is likely because the auto update process has been interrupted before it can finish or fail. In my experience this only really ever happens when debugging and shutting down the application while the auto-update process is running e.g. maybe you hit a breakpoint or exception in a hosted service or update command and then kill the application rather than letting it continue finishing startup.

The lock has a time out to work around this, which defaults to 10 minutes, this is an overly generous value and you can likely get away with a much shorter limit if your not customizing the auto-update process e.g. 2 min should still be quite generous, or even less for local development where you know there's no danger of multiple concurrent processes running. You can change this with the Cofoundry:AutoUpdate:ProcessLockTimeoutInSeconds settting.

There's no documented way to run the auto-update process manually, although obviously you can just target the database and run an instance of the site against it. Should you go down this route you can disable the auto-update process entirely with the Cofoundry:AutoUpdate:Disabled setting.

A full list of auto-update settings can be found here.

Closing, no further info.