Search code examples
codefluent

Codefluent execution timeout


I have a collection load function in my Codefluent that I use in a background process at night. Since my database is growing, it encounters a SQL execution timeout. It is fine by me that the execution takes long since it is at night and it is a background process. How can I set the timeout for a specific function?


Solution

  • If it is a background process, use a specific configuration setting for this process only with commandTimeout attribute in the CodeFluent section.

    Or you can override the CommandTimeOut of the current command before execution (CodeFluent.Runtime.CodeFluentContext.Get("XXX").Persistence.BaseCommand.CommandTimeout = 180;) where XX is the store name