Skip to content

Commit e2b229e

Browse files
committed
Duct Tape scraping fix
1 parent 39c6ebc commit e2b229e

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

OculusDB/ScrapingMaster/ScrapingNodeMongoDBManager.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,26 @@ public static void AddAppsToScrape(List<AppToScrape> appsToScrape, ScrapingNode
222222
// Add apps to be scraped
223223
// Only insert appsToScrape which ain't in appsToScrape already
224224
List<AppToScrape> appsToScrapeFiltered = new List<AppToScrape>();
225+
// add scrape for all apps on OculusDB
226+
MongoDBInteractor.applicationCollection.FindSync(x => true).ForEachAsync(x =>
227+
{
228+
AppToScrape a = new AppToScrape
229+
{
230+
appId = x.id,
231+
currency = scrapingNode.currency,
232+
headset = x.hmd,
233+
scrapePriority = AppScrapePriority.Low,
234+
addedTime = DateTime.UtcNow,
235+
};
236+
if (MongoDBInteractor.appsToScrape.Find(y => y.appId == x.id).FirstOrDefault() == null)
237+
{
238+
appsToScrapeFiltered.Add(a);
239+
}
240+
});
241+
// Add scrape for all found apps
225242
appsToScrape.ForEach(x =>
226243
{
227-
if (MongoDBInteractor.appsToScrape.Find(y => y.appId == x.appId).FirstOrDefault() == null)
244+
if (MongoDBInteractor.appsToScrape.Find(y => y.appId == x.appId).FirstOrDefault() == null && appsToScrapeFiltered.All(y => y.appId != x.appId))
228245
{
229246
x.currency = scrapingNode.currency;
230247
appsToScrapeFiltered.Add(x);

0 commit comments

Comments
 (0)