fix: use DateTime.Now instead of UtcNow in ExpirePendingOrdersService
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m33s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m33s
Database stores Created timestamps using DateTime.Now (local time). Background service was comparing with DateTime.UtcNow causing 3.5 hour offset (Iran timezone). Orders would only expire after ~4 hours instead of 30 minutes.
This commit is contained in:
@@ -60,7 +60,7 @@ public class ExpirePendingOrdersService : BackgroundService
|
||||
var context = scope.ServiceProvider.GetRequiredService<IApplicationDbContext>();
|
||||
var inventoryService = scope.ServiceProvider.GetRequiredService<IInventoryService>();
|
||||
|
||||
var cutoff = DateTime.UtcNow - ExpirationTime;
|
||||
var cutoff = DateTime.Now - ExpirationTime;
|
||||
|
||||
// پیدا کردن سفارشات Pending قدیمی
|
||||
var expiredOrders = await context.DiscountOrders
|
||||
|
||||
Reference in New Issue
Block a user