Skip to content

Commit

Permalink
Merge pull request #3 from 3xjn/dev
Browse files Browse the repository at this point in the history
Set ThreadPool constraints
  • Loading branch information
3xjn authored Jan 14, 2025
2 parents efda4fc + cc3bc75 commit ff6d71c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
8 changes: 7 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

var builder = WebApplication.CreateBuilder(args);

// Configure thread pool
ThreadPool.SetMinThreads(100, 100);

// Add logging
builder.Logging.ClearProviders();
builder.Logging.AddConsole();
Expand All @@ -27,7 +30,10 @@
.AllowCredentials());

options.AddPolicy("ProductionPolicy", policy =>
policy.WithOrigins("https://3xjn.dev")
policy.WithOrigins("https://3xjn.dev",
"https://www.3xjn.dev",
"http://3xjn.dev",
"http://www.3xjn.dev")
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials());
Expand Down
14 changes: 12 additions & 2 deletions appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Information"
"Microsoft.AspNetCore": "Information",
"Microsoft.AspNetCore.Server.Kestrel": "Warning",
"System.Threading.ThreadPool": "Warning"
}
},
"AllowedHosts": "*"
"AllowedHosts": "*",
"Kestrel": {
"Limits": {
"MaxConcurrentConnections": 100,
"MaxConcurrentUpgradedConnections": 100,
"KeepAliveTimeout": "2:00:00",
"RequestHeadersTimeout": "00:01:00"
}
}
}
2 changes: 1 addition & 1 deletion client/src/context/useTodosReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const todoReducer = (state: State, action: Action): State => {

case actionTypes.UPDATE_TODO:
return {
...state,
selectedTodoId: state.selectedTodoId,
todos: state.todos.map(todo =>
todo.id === action.payload.id ? { ...todo, ...action.payload } : todo
),
Expand Down

0 comments on commit ff6d71c

Please sign in to comment.