Skip to content

Commit 9a5396b

Browse files
committed
6.1.16
[BUG FIX] bug fix reading distributed config from cache
1 parent f108a73 commit 9a5396b

File tree

9 files changed

+25
-30
lines changed

9 files changed

+25
-30
lines changed

rls/API.Library.dll

-4 KB
Binary file not shown.

rls/API.Library.pdb

-2.02 KB
Binary file not shown.

rls/APIConfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
"CONFIG_VERSION": 1.0,
44
"API_FIREBASE_ENABLED": false,
55
"API_FIREBASE_APP_NAME": "domain.extension",
6+
"API_PERFORMANCE_ENABLED": false,
7+
"API_MEMCACHED_SALSA": "",
8+
"API_MEMCACHED_MAX_VALIDITY": "2592000",
9+
"API_MEMCACHED_MAX_SIZE": "128",
10+
"API_MEMCACHED_ENABLED": true,
11+
"API_CACHE_TRACE_ENABLED": true,
12+
"API_TRACE_ENABLED": true,
13+
"API_TRACE_RECORD_IP": true,
14+
"API_DATABASE_TRACE_ENABLED": true,
615
"API_EMAIL_ENABLED": false,
716
"API_EMAIL_MAIL_NOREPLY": "",
817
"API_EMAIL_MAIL_SENDER": "",

rls/Web.config

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="UTF-8"?>
22
<configuration>
33
<!-- Other configuration settings -->
44
<system.webServer>
@@ -9,16 +9,19 @@
99
<match url="^api\.jsonrpc(/.*)?$" />
1010
<action type="None" />
1111
</rule>
12+
1213
<!-- Rule to allow api.restful URLs -->
1314
<rule name="AllowApiRestfulUrls" stopProcessing="true">
1415
<match url="^api\.restful(/.*)?$" />
1516
<action type="None" />
1617
</rule>
18+
1719
<!-- Rule to allow api.static URLs -->
1820
<rule name="AllowApiStaticUrls" stopProcessing="true">
1921
<match url="^api\.static(/.*)?$" />
2022
<action type="None" />
2123
</rule>
24+
2225
<rule name="Return404ForOtherRequests" stopProcessing="true">
2326
<match url=".*" />
2427
<conditions>
@@ -27,11 +30,6 @@
2730
<action type="CustomResponse" statusCode="404" statusReason="Not Found" statusDescription="The requested resource was not found." />
2831
</rule>
2932
</rules>
30-
</rewrite>
31-
<handlers>
32-
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
33-
</handlers>
34-
<aspNetCore processPath="dotnet" arguments=".\Template.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
33+
</rewrite>
3534
</system.webServer>
36-
</configuration>
37-
<!--ProjectGuid: 75e5f6fe-9b9c-463d-a7fa-e1b99a6aa387-->
35+
</configuration>

rls/packages/API.Library.6.1.16.nupkg

76.7 KB
Binary file not shown.

src/API.Library/API.Library.csproj

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,12 @@
1212
<PackageId>API.Library</PackageId>
1313
<Product>API Library</Product>
1414
<Copyright>Central Statistics Office, Ireland</Copyright>
15-
<Version>6.1.15</Version>
15+
<Version>6.1.16</Version>
1616
<Authors>Central Statistics Office, Ireland</Authors>
1717
<SignAssembly>False</SignAssembly>
1818
<RepositoryUrl>https://github.com/CSOIreland/Server-API-Library</RepositoryUrl>
1919
<PackageReleaseNotes>
20-
- [ENHANCEMENT] removed auto version for APP Config and replaced it with version being set as null
21-
- [ENHANCEMENT] add distributed configuration for API config with version allowed to be null to get latest DB version
22-
- [ENHANCEMENT] moved all cache settings to appsettings.json abd are hot reloadable
23-
- [ENHANCEMENT] add version, distributed_config,API_TRACE_ENABLED,API_TRACE_RECORD_IP and refresh to IApiConfiguration interface
24-
- [ENHANCEMENT] added refresh and version, and removed auto_version from IAppConfiguration interface
25-
- [ENHANCEMENT] refactored appliction dictionary configuration code
26-
- [ENHANCEMENT] moved API tracing keys to appsettings.json and are hot reloadable
27-
- [ENHANCEMENT] moved pefromance enabled flag to appsettings.json and is hot reloadable
28-
- [ENHANCEMENT] moved datatbase tracing flag to appsettings.json and is hot reloadable
29-
- [ENHANCEMENT] check if application and api settings needs to be updated once per API request rather than per key request
30-
- [ENHANCEMENT] updated consoleconfiguration.cs
31-
- [ENHANCEMENT] updated serviceconfiguration.cs
32-
- [BUG FIX] bug fix for serializing and deserializing userpincipal object
20+
- [BUG FIX] bug fix reading distributed config from cache
3321
</PackageReleaseNotes>
3422
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
3523
<RestoreLockedMode>true</RestoreLockedMode>

src/API.Library/Config/ApiConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public bool API_TRACE_ENABLED
137137
private IDictionary<string, string> CheckSettingsAreCurrent(IDictionary<string, string> appSettings)
138138
{
139139

140-
if (CommonConfig.distributedConfigCheck(version, inMemoryVersion, distributed_config, "API", appSettings,null))
140+
if (CommonConfig.distributedConfigCheck(version, inMemoryVersion, distributed_config, "API", "api_config_version", appSettings,null))
141141
{
142142
//we have valid config
143143
if (appSettings == null)
@@ -183,7 +183,7 @@ private void ReadAppSettings()
183183
if (distributed_config == true)
184184
{
185185
//update memcache
186-
CommonConfig.memcacheSave( inMemoryVersion, "API",distributed_config, apiConfiguration);
186+
CommonConfig.memcacheSave( inMemoryVersion, "API", "api_config_version",distributed_config, apiConfiguration);
187187
}
188188
}
189189
else

src/API.Library/Config/AppConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public decimal? version
9797
private IDictionary<string, string> CheckSettingsAreCurrent(IDictionary<string, string> appSettings)
9898
{
9999

100-
if (CommonConfig.distributedConfigCheck(version, inMemoryVersion, distributed_config, "APP", ApiServicesHelper.ApiConfiguration.Settings, appSettings))
100+
if (CommonConfig.distributedConfigCheck(version, inMemoryVersion, distributed_config, "APP", "app_config_version", ApiServicesHelper.ApiConfiguration.Settings, appSettings))
101101
{
102102
//we have valid config
103103
if (appSettings == null)
@@ -143,7 +143,7 @@ private void ReadAppSettings()
143143
if (distributed_config == true)
144144
{
145145
//update memcache
146-
CommonConfig.memcacheSave(inMemoryVersion, "APP", distributed_config, appConfiguration);
146+
CommonConfig.memcacheSave(inMemoryVersion, "APP", "app_config_version", distributed_config, appConfiguration);
147147
}
148148
}
149149
else

src/API.Library/Config/CommonConfig.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace API
55
public static class CommonConfig
66
{
77

8-
public static bool distributedConfigCheck(decimal? appSettingsVersion, decimal? inMemoryVersion, bool distributed_config, string configType, IDictionary<string, string> apiDict, IDictionary<string, string> appDict)
8+
public static bool distributedConfigCheck(decimal? appSettingsVersion, decimal? inMemoryVersion, bool distributed_config, string configType,string inputDTO, IDictionary<string, string> apiDict, IDictionary<string, string> appDict)
99
{
1010
if (distributed_config == false )
1111
{
@@ -19,7 +19,7 @@ public static bool distributedConfigCheck(decimal? appSettingsVersion, decimal?
1919
ApiServicesHelper.ApplicationLoaded = false;
2020
return false;
2121
}
22-
MemCachedD_Value version_data = ApiServicesHelper.CacheD.Get_BSO<dynamic>(configType, "Configuration", "Version", "app_config_version");
22+
MemCachedD_Value version_data = ApiServicesHelper.CacheD.Get_BSO<dynamic>(configType, "Configuration", "Version", inputDTO);
2323

2424
//if record exists in cache
2525
if (version_data.hasData)
@@ -137,12 +137,12 @@ public static void deployUpdate(IADO ado, decimal? inMemoryVersion, string confi
137137
}
138138
}
139139

140-
public static void memcacheSave(decimal? inMemoryVersion, string configType, bool distributed_config, IDictionary<string, string> dict)
140+
public static void memcacheSave(decimal? inMemoryVersion, string configType,string inputDTO, bool distributed_config, IDictionary<string, string> dict)
141141
{
142142
if (distributed_config == true && ApiServicesHelper.CacheConfig.API_MEMCACHED_ENABLED == true)
143143
{
144144

145-
ApiServicesHelper.CacheD.Store_BSO<dynamic>(configType, "Configuration", "Version", "app_config_version", inMemoryVersion, DateTime.Today.AddDays(30));
145+
ApiServicesHelper.CacheD.Store_BSO<dynamic>(configType, "Configuration", "Version", inputDTO, inMemoryVersion, DateTime.Today.AddDays(30));
146146

147147
}
148148
}

0 commit comments

Comments
 (0)