Skip to content

Commit a17fd8d

Browse files
committed
ran dotnet format
1 parent f9fa898 commit a17fd8d

File tree

11 files changed

+51
-40
lines changed

11 files changed

+51
-40
lines changed

samples/Foundatio.HostingSample/Program.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@
66
using Foundatio.Extensions.Hosting.Jobs;
77
using Foundatio.Extensions.Hosting.Startup;
88
using Foundatio.HostingSample;
9-
using Foundatio.Lock;
10-
using Foundatio.Messaging;
11-
using Foundatio.Serializer;
129
using Microsoft.AspNetCore.Builder;
1310
using Microsoft.AspNetCore.Http;
14-
using Microsoft.Extensions.Configuration;
1511
using Microsoft.Extensions.DependencyInjection;
1612
using Microsoft.Extensions.Hosting;
1713
using Microsoft.Extensions.Logging;
18-
using Microsoft.Extensions.Options;
1914
#if REDIS
2015
using System.Text.Json;
2116
using Microsoft.AspNetCore.Http.Json;

src/Foundatio.Extensions.Hosting/Jobs/JobManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void AddOrUpdate<TJob>(Action<ScheduledJobOptionsBuilder> configure = nul
5959
{
6060
var options = new ScheduledJobOptions
6161
{
62-
Name = jobName,
62+
Name = jobName,
6363
JobFactory = sp => sp.GetRequiredService<TJob>()
6464
};
6565
var builder = new ScheduledJobOptionsBuilder(options);

src/Foundatio.Extensions.Hosting/Jobs/ScheduledJobService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ await _messageBus.SubscribeAsync<JobStateChangedMessage>(s =>
124124

125125
job.NextRun ??= job.GetNextScheduledRun();
126126
}
127-
} catch (Exception ex)
127+
}
128+
catch (Exception ex)
128129
{
129130
_logger.LogError(ex, "Error retrieving job next run times: {Message}", ex.Message);
130131
}

src/Foundatio.TestHarness/Jobs/JobQueueTestsBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using Foundatio.Jobs;
1010
using Foundatio.Lock;
1111
using Foundatio.Queues;
12-
using Foundatio.Tests.Utility;
1312
using Foundatio.Xunit;
1413
using Microsoft.Extensions.Logging;
1514
using Xunit;

src/Foundatio.Xunit/Logging/TestLogger.cs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,13 @@ public bool IsEnabled(string category, LogLevel logLevel)
144144
}
145145

146146
_lock.EnterReadLock();
147-
try {
147+
try
148+
{
148149
var current = _root;
149150
LogLevel effectiveLevel = DefaultLogLevel;
150151

151-
for (int i = 0; i < count; i++) {
152+
for (int i = 0; i < count; i++)
153+
{
152154
var segment = span.Slice(segments[i].Start, segments[i].Length);
153155
bool found = false;
154156

@@ -171,7 +173,9 @@ public bool IsEnabled(string category, LogLevel logLevel)
171173
}
172174

173175
return logLevel >= effectiveLevel;
174-
} finally {
176+
}
177+
finally
178+
{
175179
_lock.ExitReadLock();
176180
}
177181
}
@@ -180,17 +184,22 @@ public void SetLogLevel(string category, LogLevel minLogLevel)
180184
{
181185
string[] parts = category.Split('.');
182186
_lock.EnterWriteLock();
183-
try {
187+
try
188+
{
184189
var current = _root;
185-
foreach (string part in parts) {
186-
if (!current.Children.TryGetValue(part, out var child)) {
190+
foreach (string part in parts)
191+
{
192+
if (!current.Children.TryGetValue(part, out var child))
193+
{
187194
child = new Node();
188195
current.Children[part] = child;
189196
}
190197
current = child;
191198
}
192199
current.Level = minLogLevel;
193-
} finally {
200+
}
201+
finally
202+
{
194203
_lock.ExitWriteLock();
195204
}
196205
}
@@ -202,7 +211,8 @@ public void SetLogLevel<T>(LogLevel minLogLevel)
202211

203212
public void Dispose() { }
204213

205-
private class Node {
214+
private class Node
215+
{
206216
public readonly Dictionary<string, Node> Children = new(StringComparer.OrdinalIgnoreCase);
207217
public LogLevel? Level;
208218
}

src/Foundatio/Jobs/IJob.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Linq;
43
using System.Threading;
54
using System.Threading.Tasks;

src/Foundatio/Queues/InMemoryQueue.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.Threading.Tasks;
99
using Foundatio.AsyncEx;
1010
using Foundatio.Utility;
11-
using Foundatio.Utility.Resilience;
1211
using Microsoft.Extensions.Logging;
1312

1413
namespace Foundatio.Queues;

src/Foundatio/Utility/ResiliencePolicy.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ public ResiliencePolicy(ILogger logger = null, TimeProvider timeProvider = null)
129129
/// <summary>
130130
/// Gets or sets the logger for this policy.
131131
/// </summary>
132-
public ILogger Logger {
132+
public ILogger Logger
133+
{
133134
get => _logger;
134135
set => _logger = value ?? NullLogger.Instance;
135136
}
@@ -142,7 +143,7 @@ public ILogger Logger {
142143
/// <summary>
143144
/// A collection of exception types that will not be handled by the policy. These exceptions will be thrown immediately without retrying. Default includes OperationCanceledException.
144145
/// </summary>
145-
public HashSet<Type> UnhandledExceptions { get; set; } = [ typeof(OperationCanceledException) ];
146+
public HashSet<Type> UnhandledExceptions { get; set; } = [typeof(OperationCanceledException)];
146147

147148
/// <summary>
148149
/// A function that determines whether to retry based on the attempt number and exception.
@@ -344,7 +345,8 @@ public CircuitBreaker(ILogger logger = null, TimeProvider timeProvider = null)
344345
/// <summary>
345346
/// Gets or sets the logger for this circuit breaker.
346347
/// </summary>
347-
public ILogger Logger {
348+
public ILogger Logger
349+
{
348350
get => _logger;
349351
set => _logger = value ?? NullLogger.Instance;
350352
}
@@ -372,7 +374,7 @@ public ILogger Logger {
372374
/// <summary>
373375
/// A collection of exception types that will not be recorded by the circuit breaker. These exceptions will not trigger the circuit breaker to open. Default includes OperationCanceledException.
374376
/// </summary>
375-
public HashSet<Type> UnrecordedExceptions { get; set; } = [ typeof(OperationCanceledException) ];
377+
public HashSet<Type> UnrecordedExceptions { get; set; } = [typeof(OperationCanceledException)];
376378

377379
/// <summary>
378380
/// Gets or sets a function that determines whether to record an exception.
@@ -705,7 +707,7 @@ public ResiliencePolicyBuilder WithTimeout(TimeSpan timeout)
705707
public ResiliencePolicyBuilder WithCircuitBreaker()
706708
{
707709
_policy.CircuitBreaker = new CircuitBreaker(_policy.Logger, _policy.GetTimeProvider());
708-
return this;;
710+
return this;
709711
}
710712

711713
/// <summary>
@@ -715,7 +717,7 @@ public ResiliencePolicyBuilder WithCircuitBreaker()
715717
public ResiliencePolicyBuilder WithCircuitBreaker(ICircuitBreaker circuitBreaker)
716718
{
717719
_policy.CircuitBreaker = circuitBreaker;
718-
return this;;
720+
return this;
719721
}
720722

721723
/// <summary>

src/Foundatio/Utility/Run.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.Threading;
33
using System.Threading.Tasks;
4+
using Foundatio.Utility.Resilience;
45
using Microsoft.Extensions.Logging;
56
using Microsoft.Extensions.Logging.Abstractions;
6-
using Foundatio.Utility.Resilience;
77

88
namespace Foundatio.Utility;
99

src/Foundatio/Utility/SharedOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
2-
using Foundatio.Utility.Resilience;
32
using Foundatio.Serializer;
3+
using Foundatio.Utility.Resilience;
44
using Microsoft.Extensions.Logging;
55

66
namespace Foundatio;

0 commit comments

Comments
 (0)