Skip to content

Commit 3d68c0f

Browse files
author
Matteo Bortolazzo
authored
Merge pull request #44 from matteobortolazzo/dev
Release 1.1.2
2 parents c325624 + a17c258 commit 3d68c0f

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# 1.1.1 (2019-06-02)
1+
# 1.1.2 (2019-06-08)
2+
3+
## Bug Fixes
4+
* **Client:** Prevent deadlocks when run against .NET Framework. ([#PR43](https://github.com/matteobortolazzo/couchdb-net/pull/43))
5+
6+
# 1.1.1 (2019-06-02)
27

38
## Features
49
* **Single/SingleOrDefault:** Methods implementated as composite supported methods (Where and Take(2)).

LATEST_CHANGE.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
## Features
2-
* **Single/SingleOrDefault:** Methods implementated as composite supported methods (Where and Take(2)).
3-
4-
## Bug Fixes
5-
* **Queries:** Implicit bools in nested methods. ([#PR41](https://github.com/matteobortolazzo/couchdb-net/pull/41))
6-
* **FxCopAnalyzers:** Removed from NuGet dependencies.
1+
## Bug Fixes
2+
* **Client:** Prevent deadlocks when run against .NET Framework. ([#PR43](https://github.com/matteobortolazzo/couchdb-net/pull/43))

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ var client = new CouchClient("http://localhost", s => s
297297
| SetDocumentCase | Sets the format case for documents. |
298298
| SetPropertyCase | Sets the format case for properties. |
299299
| EnsureDatabaseExists | If a database doesn't exists, it creates it. |
300+
| DisableLogOutOnDispose | Disables log out on client dispose. |
300301

301302
- **DocumentCaseTypes**: None, UnderscoreCase *(default)*, DashCase, KebabCase.
302303
- **PropertyCaseTypes**: None, CamelCase *(default)*, PascalCase, UnderscoreCase, DashCase, KebabCase.

src/CouchDB.Driver/CouchClient.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ public void Dispose()
303303

304304
protected virtual void Dispose(bool disposing)
305305
{
306-
AsyncContext.Run(() => LogoutAsync());
306+
if (_settings.AuthenticationType == AuthenticationType.Cookie && _settings.LogOutOnDispose)
307+
{
308+
AsyncContext.Run(() => LogoutAsync().ConfigureAwait(false));
309+
}
307310
_flurlClient.Dispose();
308311
}
309312

src/CouchDB.Driver/Settings/CouchSettings.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class CouchSettings
2323
internal DocumentCaseType DocumentsCaseType { get; private set; }
2424
internal PropertyCaseType PropertiesCase { get; private set; }
2525
internal bool CheckDatabaseExists { get; private set; }
26+
internal bool LogOutOnDispose { get; private set; }
2627
internal Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> ServerCertificateCustomValidationCallback { get; private set; }
2728

2829
internal CouchSettings()
@@ -31,6 +32,7 @@ internal CouchSettings()
3132
PluralizeEntitis = true;
3233
DocumentsCaseType = DocumentCaseType.UnderscoreCase;
3334
PropertiesCase = PropertyCaseType.CamelCase;
35+
LogOutOnDispose = true;
3436
}
3537

3638
/// <summary>
@@ -144,5 +146,14 @@ public CouchSettings EnsureDatabaseExists()
144146
CheckDatabaseExists = true;
145147
return this;
146148
}
149+
/// <summary>
150+
/// Disables log out on client dispose.
151+
/// </summary>
152+
/// <returns>The current settings</returns>
153+
public CouchSettings DisableLogOutOnDispose()
154+
{
155+
LogOutOnDispose = false;
156+
return this;
157+
}
147158
}
148159
}

0 commit comments

Comments
 (0)