Extension on service for command time out

This commit is contained in:
rowell_m_soriano 2026-01-20 13:29:31 +08:00
parent 8313b112fc
commit 1390642e0a

View File

@ -86,21 +86,21 @@ namespace CPRNIMS.WebApi.Common
options.UseSqlServer(defaultConn, sql => options.UseSqlServer(defaultConn, sql =>
{ {
sql.EnableRetryOnFailure(5, TimeSpan.FromHours(2), null); sql.EnableRetryOnFailure(5, TimeSpan.FromHours(2), null);
sql.CommandTimeout(2); sql.CommandTimeout(20);
})); }));
services.AddDbContext<PurchLocalDbContext>(options => services.AddDbContext<PurchLocalDbContext>(options =>
options.UseSqlServer(localConn, sql => options.UseSqlServer(localConn, sql =>
{ {
sql.EnableRetryOnFailure(5, TimeSpan.FromHours(2), null); sql.EnableRetryOnFailure(5, TimeSpan.FromHours(2), null);
sql.CommandTimeout(2); sql.CommandTimeout(20);
})); }));
services.AddDbContext<AuhorizationDbContext>(options => services.AddDbContext<AuhorizationDbContext>(options =>
options.UseSqlServer(defaultConn, sql => options.UseSqlServer(defaultConn, sql =>
{ {
sql.EnableRetryOnFailure(5, TimeSpan.FromHours(2), null); sql.EnableRetryOnFailure(5, TimeSpan.FromHours(2), null);
sql.CommandTimeout(2); sql.CommandTimeout(20);
})); }));
} }