This commit is contained in:
@@ -414,7 +414,7 @@ namespace AyaNova
|
||||
// ******************** TESTING WIPE DB *****************************
|
||||
//
|
||||
//Set this to true to wipe the db and reinstall a trial license and re-seed the data
|
||||
var TESTING_REFRESH_DB = false;//#######################################################################################
|
||||
var TESTING_REFRESH_DB = true;//#######################################################################################
|
||||
|
||||
#if (DEBUG)
|
||||
|
||||
@@ -455,7 +455,7 @@ namespace AyaNova
|
||||
{
|
||||
AyaNova.Core.License.FetchKeyAsync(apiServerState, dbContext, _newLog).Wait();
|
||||
//NOTE: For unit testing make sure the time zone in util is set to the same figure as here to ensure list filter by date tests will work because server is on same page as user in terms of time
|
||||
Util.Seeder.SeedDatabaseAsync(Util.Seeder.SeedLevel.SmallOneManShopTrialDataSet, -7).Wait();//#############################################################################################
|
||||
Util.Seeder.SeedDatabaseAsync(Util.Seeder.SeedLevel.MediumLocalServiceCompanyTrialDataSet, -7).Wait();//#############################################################################################
|
||||
}
|
||||
//TESTING
|
||||
#endif
|
||||
@@ -484,7 +484,7 @@ namespace AyaNova
|
||||
_newLog.LogInformation($"BOOT: Active techs - {UserBiz.ActiveCountAsync().Result}");
|
||||
|
||||
//Log the license info so it's on the record
|
||||
_newLog.LogInformation($"BOOT: License {AyaNova.Core.License.LicenseInfoLogFormat}");
|
||||
_newLog.LogInformation($"BOOT: License - [{AyaNova.Core.License.LicenseInfoLogFormat}]");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -704,8 +704,21 @@ cache or provide directly the locale to save time repeatedly fetching it when do
|
||||
}
|
||||
}
|
||||
|
||||
//Get the current stopwords for the user's locale
|
||||
//called in here in this class and also by any bulk ops like seeding etc
|
||||
private static Dictionary<long, LocaleWordBreakingData> localeWordBreakingDataCache = new Dictionary<long, LocaleWordBreakingData>();
|
||||
|
||||
// //called at startup to populate cache
|
||||
// internal static async Task CacheAllLocaleWordBreakingData(){
|
||||
// //iterate all locales, cache the word break data
|
||||
// l = await ct.Locale
|
||||
// .AsNoTracking()
|
||||
// .OrderBy(m => m.Name)
|
||||
// .Select(m => new NameIdItem()
|
||||
// {
|
||||
// Id = m.Id,
|
||||
// Name = m.Name
|
||||
// }).ToListAsync();
|
||||
// localeWordBreakingDataCache.Add(localeId, await GetLocaleSearchDataAsync(localeId));
|
||||
// }
|
||||
internal static async Task<LocaleWordBreakingData> GetLocaleSearchDataAsync(long localeId, AyContext ct = null)
|
||||
{
|
||||
LocaleWordBreakingData LSD = new LocaleWordBreakingData();
|
||||
@@ -782,13 +795,13 @@ cache or provide directly the locale to save time repeatedly fetching it when do
|
||||
/// used for eliminating noise words from search dictionary
|
||||
/// </summary>
|
||||
|
||||
private static Dictionary<long, LocaleWordBreakingData> localeWordBreakingDataCache = new Dictionary<long, LocaleWordBreakingData>();
|
||||
//called by Locale in the rare circumstance that a local has changed that is cached
|
||||
//and might affect word breaking (stopwords cjkindex etc)
|
||||
internal static void ClearLocaleWordBreakingDataCache(long localeId)
|
||||
{
|
||||
localeWordBreakingDataCache.Remove(localeId);
|
||||
}
|
||||
|
||||
// //called by Locale in the rare circumstance that a locale has changed that is cached
|
||||
// //and might affect word breaking (stopwords cjkindex etc)
|
||||
// internal static void ClearLocaleWordBreakingDataCache(long localeId)
|
||||
// {
|
||||
// localeWordBreakingDataCache.Remove(localeId);
|
||||
// }
|
||||
|
||||
internal static async Task<List<string>> BreakCoreAsync(long localeId, bool KeepWildCards, List<string> textStrings)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace AyaNova.Core
|
||||
private static Guid TEST_TRIAL_KEY_DBID = new Guid("{A6D18A8A-5613-4979-99DA-80D07641A2FE}");
|
||||
|
||||
|
||||
|
||||
|
||||
//Current license key, can be empty
|
||||
private static AyaNovaLicenseKey _ActiveLicense = new AyaNovaLicenseKey();
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace AyaNova.Core
|
||||
internal class AyaNovaLicenseKey
|
||||
{
|
||||
public AyaNovaLicenseKey()
|
||||
{
|
||||
{
|
||||
Features = new List<LicenseFeature>();
|
||||
RegisteredTo = "UNLICENSED";
|
||||
Id = RegisteredTo;
|
||||
@@ -280,7 +280,7 @@ namespace AyaNova.Core
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Fetch a summary of the license key for displaying in the log
|
||||
/// </summary>
|
||||
/// <returns> string containing current license information</returns>
|
||||
@@ -292,11 +292,11 @@ namespace AyaNova.Core
|
||||
|
||||
if (ActiveKey.IsEmpty)
|
||||
{
|
||||
return $"UNLICENSED, DB ID: {DbId}";
|
||||
return $"UNLICENSED, DB ID: {DbId}";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
if (ActiveKey.TrialLicense)
|
||||
sb.Append("TRIAL, ");
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace AyaNova.Core
|
||||
}
|
||||
|
||||
}
|
||||
return sb.ToString();
|
||||
return sb.ToString().Trim().TrimEnd(',');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ namespace AyaNova.Core
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
//string RawTextKeyFromRockfish = await _Client.GetStringAsync(sUrl);
|
||||
string RawTextKeyFromRockfish = await ServiceProviderProvider.HttpClientFactory.CreateClient().GetStringAsync(sUrl);
|
||||
//FUTURE: if there is any kind of error response or REASON or LicenseFetchStatus then here is
|
||||
|
||||
Reference in New Issue
Block a user