Skip to content

Commit

Permalink
Merge pull request #2 from colinnuk/dotnet_8
Browse files Browse the repository at this point in the history
Upgrade lib to dotnet 8
  • Loading branch information
colinnuk authored Apr 30, 2024
2 parents 0f46876 + 3b47c1a commit 9fb4019
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
workflow_dispatch:

env:
DOTNET_VERSION: '6.x.x' # The .NET SDK version to use
DOTNET_VERSION: '8.x.x' # The .NET SDK version to use

jobs:
build-and-test:
Expand Down
9 changes: 6 additions & 3 deletions OpenMeteo/HttpController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Http;

namespace OpenMeteo
Expand All @@ -15,7 +13,12 @@ internal class HttpController

public HttpController()
{
_httpClient = new HttpClient();
var socketHttpHandler = new SocketsHttpHandler()
{
PooledConnectionLifetime = TimeSpan.FromMinutes(4),
};
_httpClient = new HttpClient(socketHttpHandler);

_httpClient.DefaultRequestHeaders.Accept.Clear();
_httpClient.DefaultRequestHeaders.Accept.Add(
new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")
Expand Down
6 changes: 3 additions & 3 deletions OpenMeteo/OpenMeteo.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<PackageId>$(AssemblyName).colinnuk.dotnet</PackageId>
<Title>Open Meteo Dotnet Library</Title>
<Title>Open Meteo Dotnet 8 Library</Title>
<Version>0.0.3</Version>
<Authors>AlienDwarf</Authors>
<Company />
Expand All @@ -17,7 +17,7 @@
<AssemblyVersion>0.0.1</AssemblyVersion>
<FileVersion>0.0.1</FileVersion>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Description>A .Net Standard 2.1 library for the Open-Meteo.com API.</Description>
<Description>A DotNet 8 library for the Open-Meteo.com API.</Description>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<SignAssembly>False</SignAssembly>
Expand Down
2 changes: 1 addition & 1 deletion OpenMeteoTests/OpenMeteoTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down

0 comments on commit 9fb4019

Please sign in to comment.