Skip to content

Commit 156be66

Browse files
committed
chore: finished marketplace sync update
1 parent 9e4f4b8 commit 156be66

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

MarketplaceSyncFunction/MarketplaceSync.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Net.Http.Headers;
77
using System.Threading.Tasks;
88
using Common;
9+
using Common.TableModels;
910
using Install;
1011
using Microsoft.Azure.WebJobs;
1112
using Microsoft.Extensions.Logging;
@@ -23,8 +24,7 @@ public static class MarketplaceSync
2324
[Singleton]
2425
[FunctionName("MarketplaceSync")]
2526
public static async Task TimerTrigger(
26-
[TimerTrigger("0 0 * * * *", RunOnStartup = true)]
27-
TimerInfo timerInfo,
27+
[TimerTrigger("0 0 * * * *", RunOnStartup = true)]TimerInfo timerInfo,
2828
ILogger logger,
2929
ExecutionContext context)
3030
{
@@ -61,7 +61,6 @@ public static async Task RunAsync(
6161
var planResponse = await HttpClient.SendAsync(planRequest);
6262
var planJson = await planResponse.Content.ReadAsStringAsync();
6363

64-
Console.WriteLine(planJson);
6564
Account[] accountsInPlan = new Account[0];
6665
try
6766
{
@@ -97,8 +96,8 @@ public static async Task RunAsync(
9796
"PlanId eq " + planId.ToString()).Take(1000);
9897

9998
TableContinuationToken contToken = null;
100-
var queryOptions = new TableRequestOptions();
10199

100+
var deletedPurchases = new List<string>();
102101
do
103102
{
104103
var rows = await marketplaceTable.ExecuteQuerySegmentedAsync(query, contToken);
@@ -114,12 +113,14 @@ public static async Task RunAsync(
114113
continue;
115114
}
116115

117-
Console.WriteLine("should be deleted");
118-
Console.WriteLine(purchase.AccountId);
116+
deletedPurchases.Add(purchase.PartitionKey);
117+
118+
// await marketplaceTable.DropRow(purchase.PartitionKey, purchase.AccountLogin);
119119
}
120120
}
121121
while (contToken != null);
122122

123+
logger.LogInformation("MarketplaceSync missing git purchases " + JsonConvert.SerializeObject(deletedPurchases));
123124
logger.LogInformation("MarketplaceSync finished");
124125
}
125126
}

0 commit comments

Comments
 (0)