-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update packages and change target frameworks (#122)
- Loading branch information
Showing
42 changed files
with
320 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -338,3 +338,4 @@ tools/** | |
|
||
__mismatch__/ | ||
*.Development.json | ||
appsettings.*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"sdk": { | ||
"version": "3.1.401" | ||
"version": "5.0.103" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Clients/test/AspNetCore.FunctionalTest/AspNetCore.FunctionalTest.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly:InternalsVisibleTo("Thor.Core.Tests")] | ||
[assembly:InternalsVisibleTo("Thor.Core.Http.Tests")] | ||
[assembly:InternalsVisibleTo("Thor.Extensions.HotChocolate.Tests")] | ||
[assembly:InternalsVisibleTo("Thor.Extensions.Hosting.Tests")] | ||
[assembly:InternalsVisibleTo("Thor.Hosting.AspNetCore.Tests")] | ||
[assembly:InternalsVisibleTo("Thor.Hosting.AspNetCore.Tests")] | ||
[assembly:InternalsVisibleTo("Thor.Core.Transmission.EventHub")] | ||
[assembly:InternalsVisibleTo("Thor.Core.Transmission.BlobStorage")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Threading; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Thor.Core.Transmission.EventHub | ||
{ | ||
/// <summary> | ||
/// Creates a log entry limited per interval | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
internal class ErrorLogger<T> | ||
{ | ||
private readonly ILogger<T> _logger; | ||
private readonly string _instance; | ||
|
||
private readonly TimeSpan _interval = TimeSpan.FromMinutes(10); | ||
private readonly Stopwatch _errorWatch; | ||
private int _errorsPerInterval = 1; | ||
private int _errorCount; | ||
|
||
/// <summary> | ||
/// The watcher ctor | ||
/// </summary> | ||
public ErrorLogger(ILogger<T> logger) | ||
{ | ||
_logger = logger; | ||
_errorWatch = new Stopwatch(); | ||
_instance = typeof(T).Name; | ||
} | ||
|
||
/// <summary> | ||
/// Create a error log entry if interval elapsed or number of errors per interval not exceeded | ||
/// </summary> | ||
/// <param name="exception"></param> | ||
public void Log(Exception exception) | ||
{ | ||
if (_errorCount < _errorsPerInterval) | ||
{ | ||
_logger.LogError(exception, $"{_instance} failed"); | ||
Interlocked.Increment(ref _errorCount); | ||
} | ||
|
||
if (!_errorWatch.IsRunning) | ||
{ | ||
_errorWatch.Restart(); | ||
} | ||
|
||
if (_errorWatch.Elapsed > _interval) | ||
{ | ||
Interlocked.Exchange(ref _errorCount, 0); | ||
_errorWatch.Restart(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.