Skip to content

Commit

Permalink
reverted removal of ClearOrderCache function.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasSort committed May 29, 2024
1 parent 546a065 commit 0a4a5fe
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/OrderSourceReader.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dynamicweb.DataIntegration.Integration;
using Dynamicweb.Ecommerce.Orders;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
Expand Down Expand Up @@ -189,15 +190,17 @@ public static void UpdateExportedOrdersInDb(string orderStateIDAfterExport, SqlC
if (!string.IsNullOrEmpty(ids))
{
command.CommandText = sql + string.Format(" WHERE [OrderID] IN ('{0}')", ids);
command.ExecuteNonQuery();
command.ExecuteNonQuery();
ClearOrderCache(idsCollection);
}
taken = taken + step;
}
}
else
{
command.CommandText = sql + string.Format(" WHERE [OrderID] IN ('{0}')", string.Join("','", _ordersToExport));
command.ExecuteNonQuery();
command.ExecuteNonQuery();
ClearOrderCache(_ordersToExport);
}
command.Transaction.Commit();
}
Expand All @@ -213,6 +216,15 @@ public static void UpdateExportedOrdersInDb(string orderStateIDAfterExport, SqlC
}
}
}

private static void ClearOrderCache(IEnumerable<string> orderIds)
{
OrderService os = new();
foreach (string id in orderIds)
{
os.RemoveOrderCache(id);
}
}
}
}

0 comments on commit 0a4a5fe

Please sign in to comment.