Changed Shop interface to be more asynchronous.

Implemented changes in Props.

Implemented said changes in AdafruitShop.

Fixed and improved caching in AdafruitShop.
This commit is contained in:
2021-08-11 23:54:52 -05:00
parent ff080390f8
commit 8a1e5aca15
12 changed files with 145 additions and 76 deletions

View File

@@ -6,14 +6,12 @@ namespace Props.Shop.Adafruit.Persistence
public int MinDownloadInterval { get; set; }
public int CacheLifespan { get; set; }
public float Similarity { get; set; }
public string ProductListingCacheFileName { get; set; }
public Configuration()
{
MinDownloadInterval = 5 * 60 * 1000;
Similarity = 0.8f;
CacheLifespan = 5 * 60 * 1000;
ProductListingCacheFileName = "ProductListings.json";
}
}
}

View File

@@ -7,7 +7,7 @@ namespace Props.Shop.Adafruit.Persistence
public class ProductListingCacheData
{
public const string FILE_NAME = "Product-listing-cache.json";
public DateTime LastUpdatedUtc { get; private set; }
public DateTime LastUpdatedUtc { get; set; }
public IReadOnlyDictionary<string, IList<ProductListing>> ProductListings { get; set; }
public ProductListingCacheData(IReadOnlyDictionary<string, IList<ProductListing>> productListings)