Skip to content

Commit

Permalink
Merge pull request #25 from dynamicweb/mss/19751
Browse files Browse the repository at this point in the history
removed calls to clear cache
  • Loading branch information
frederik5480 authored May 31, 2024
2 parents a1f8ead + 0a4a5fe commit cf167ac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.0.15</Version>
<Version>10.0.16</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Title>Order Provider</Title>
<Description>Order Provider</Description>
Expand Down
1 change: 0 additions & 1 deletion src/OrderProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ public override bool RunJob(Job job)
RemoveMissingRows(writers, sqlTransaction);

sqlTransaction.Commit();
Ecommerce.Services.Orders.ClearCache();
}
catch (Exception ex)
{
Expand Down
9 changes: 5 additions & 4 deletions src/OrderSourceReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public OrderSourceReader(Mapping mapping, SqlConnection connection, bool exportN
public new void Write(Dictionary<string, object> row)
{
base.Write(row);
// Need to clear cache for the order when doing response-mappings
Ecommerce.Services.Orders.ClearCache(Core.Converter.ToString(_reader["OrderId"]));
}

Expand Down Expand Up @@ -155,7 +156,7 @@ public override Dictionary<string, object> GetNext()
row.Add("OrderId", orderId);
}
}
}
}
return row;
}

Expand Down Expand Up @@ -189,7 +190,7 @@ 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;
Expand All @@ -198,7 +199,7 @@ public static void UpdateExportedOrdersInDb(string orderStateIDAfterExport, SqlC
else
{
command.CommandText = sql + string.Format(" WHERE [OrderID] IN ('{0}')", string.Join("','", _ordersToExport));
command.ExecuteNonQuery();
command.ExecuteNonQuery();
ClearOrderCache(_ordersToExport);
}
command.Transaction.Commit();
Expand All @@ -218,7 +219,7 @@ public static void UpdateExportedOrdersInDb(string orderStateIDAfterExport, SqlC

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

0 comments on commit cf167ac

Please sign in to comment.