Skip to content

Commit

Permalink
服务端使用net8,方便用户一键式安装,兼容性更好
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Dec 26, 2024
1 parent 20a3357 commit 981ac83
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion DeployAgent/DeployAgent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net461;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net461;net8.0;net9.0</TargetFrameworks>
<AssemblyTitle>星尘发布</AssemblyTitle>
<Description>自动下载代码,编译后打包输出并推送发布中心。</Description>
<Company>新生命开发团队</Company>
Expand Down
2 changes: 1 addition & 1 deletion StarAgent/StarAgent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net45;net461;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net45;net461;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<AssemblyTitle>星尘代理</AssemblyTitle>
<Description>星尘,分布式资源调度,部署于每一个节点,连接服务端,支持节点监控、远程发布。</Description>
<Company>新生命开发团队</Company>
Expand Down
2 changes: 1 addition & 1 deletion StarGateway/StarGateway.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyTitle>星尘网关</AssemblyTitle>
<Description>星尘网关,转发网络请求,实现路由切换。</Description>
<Company>新生命开发团队</Company>
Expand Down
7 changes: 3 additions & 4 deletions Stardust.Data/Monitors/应用跟踪器.Biz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using NewLife.Data;
using XCode;
using XCode.Cache;
using XCode.Membership;

namespace Stardust.Data.Monitors;

Expand Down Expand Up @@ -149,7 +148,7 @@ public static AppTracer FindByName(String name)
/// <returns>实体列表</returns>
public static IList<AppTracer> FindAllByAppId(Int32 appId)
{
if (appId <= 0) return new List<AppTracer>();
if (appId <= 0) return [];

// 实体缓存
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.AppId == appId);
Expand All @@ -162,7 +161,7 @@ public static IList<AppTracer> FindAllByAppId(Int32 appId)
/// <returns>实体列表</returns>
public static IList<AppTracer> FindAllByProjectId(Int32 projectId)
{
if (projectId <= 0) return new List<AppTracer>();
if (projectId <= 0) return [];

// 实体缓存
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.ProjectId == projectId);
Expand Down Expand Up @@ -197,7 +196,7 @@ public static IList<AppTracer> Search(Int32 projectId, Int32 appId, String categ
}

// Select Count(ID) as ID,Category From AppTracer Where CreateTime>'2020-01-24 00:00:00' Group By Category Order By ID Desc limit 20
static readonly FieldCache<AppTracer> _CategoryCache = new FieldCache<AppTracer>(nameof(Category));
static readonly FieldCache<AppTracer> _CategoryCache = new(nameof(Category));

/// <summary>获取类别列表,字段缓存10分钟,分组统计数据最多的前20种,用于魔方前台下拉选择</summary>
/// <returns></returns>
Expand Down
2 changes: 1 addition & 1 deletion Stardust.Data/Stardust.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyTitle>星尘数据</AssemblyTitle>
<Description>星尘,分布式服务框架。分布式资源调度,服务自动注册和发现,负载均衡,动态伸缩,故障转移,性能监控。</Description>
<Company>新生命开发团队</Company>
<Copyright>©2002-2022 NewLife</Copyright>
<Copyright>©2002-2025 NewLife</Copyright>
<VersionPrefix>2.0</VersionPrefix>
<VersionSuffix>$([System.DateTime]::Now.ToString(`yyyy.MMdd`))</VersionSuffix>
<Version>$(VersionPrefix).$(VersionSuffix)</Version>
Expand Down
2 changes: 1 addition & 1 deletion Stardust.Server/Controllers/LogController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public async Task<EmptyResult> Post()
sb.AppendLine(lines[j]);
i++;
}
msg = sb.Put(true);
msg = sb.Return(true);

AppClientLog.Create(app.Id, clientId, ss, msg, ip);
sb.Clear();
Expand Down
4 changes: 3 additions & 1 deletion Stardust.Server/Models/ConfigInModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stardust.Server.Models;

#pragma warning disable CS8632 // 只能在 "#nullable" 注释上下文内的代码中使用可为 null 的引用类型的注释。
/// <summary>配置入参</summary>
public class ConfigInModel
{
Expand All @@ -26,4 +27,5 @@ public class ConfigInModel

/// <summary>缺失的键</summary>
public String? MissedKeys { get; set; }
}
}
#pragma warning restore CS8632 // 只能在 "#nullable" 注释上下文内的代码中使用可为 null 的引用类型的注释。
4 changes: 3 additions & 1 deletion Stardust.Server/Models/SetConfigModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stardust.Server.Models;

#pragma warning disable CS8632 // 只能在 "#nullable" 注释上下文内的代码中使用可为 null 的引用类型的注释。
/// <summary>配置入参</summary>
public class SetConfigModel
{
Expand All @@ -14,4 +15,5 @@ public class SetConfigModel

/// <summary>配置数据</summary>
public IDictionary<String, Object> Configs { get; set; }
}
}
#pragma warning restore CS8632 // 只能在 "#nullable" 注释上下文内的代码中使用可为 null 的引用类型的注释。
4 changes: 3 additions & 1 deletion Stardust.Server/Models/TokenInModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Stardust.Server.Models;

#pragma warning disable CS8632 // 只能在 "#nullable" 注释上下文内的代码中使用可为 null 的引用类型的注释。
/// <summary>访问令牌输入参数</summary>
public class TokenInModel
{
Expand All @@ -17,4 +18,5 @@ public class TokenInModel

/// <summary>刷新令牌</summary>
public String? refresh_token { get; set; }
}
}
#pragma warning restore CS8632 // 只能在 "#nullable" 注释上下文内的代码中使用可为 null 的引用类型的注释。
2 changes: 1 addition & 1 deletion Stardust.Server/Stardust.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>StarServer</AssemblyName>
<AssemblyTitle>星尘服务平台</AssemblyTitle>
<Description>星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心</Description>
Expand Down
2 changes: 1 addition & 1 deletion Stardust.Web/Stardust.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>StarWeb</AssemblyName>
<AssemblyTitle>星尘管理平台</AssemblyTitle>
<Description>星尘,分布式服务框架。节点管理,监控中心,配置中心,发布中心,注册中心</Description>
Expand Down
2 changes: 1 addition & 1 deletion Tools/Resources/linux-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
echo "Install Stardust on Linux"

if [ ! -d "/usr/share/dotnet/" ]; then
curl https://x.newlifex.com/dotnet/net.sh | sudo bash
curl https://x.newlifex.com/dotnet/net8.sh | sudo bash
fi

sudo dotnet agent\StarAgent.dll -install -server http://127.0.0.1:6600
2 changes: 1 addition & 1 deletion Tools/Resources/run.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

echo "Run Stardust on Windows"

clover40.exe net9-aspnet -silent
clover40.exe net8-host -silent

start agent\StarAgent.exe -run -server http://127.0.0.1:6600

Expand Down
2 changes: 1 addition & 1 deletion Tools/Resources/windows-service.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

echo "Install Stardust as service on Windows"

clover40.exe net9-aspnet -silent
clover40.exe net8-host -silent

agent\StarAgent.exe -install -server http://127.0.0.1:6600

Expand Down
3 changes: 1 addition & 2 deletions Tools/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ move %base%\StarWeb.zip %out%\StarWeb.zip

set out=%base%\agent
rmdir /s/q %out%
dotnet publish ..\StarAgent\StarAgent.csproj --nologo -c Release -f net9.0 -o %out%
dotnet publish ..\StarAgent\StarAgent.csproj --nologo -c Release -f net8.0 -o %out%
del /f/s/q %out%\*.pdb %out%\*.xml %out%\*.deps.json

mkdir %out%\Config
Expand All @@ -30,7 +30,6 @@ xcopy Resources\*.sh %base%\ /y/s
copy clover40.exe %base%\clover40.exe /y

mkdir %base%\Plugins
xcopy Resources\Plugins\*.dll %base%\Plugins\ /y/s

del %base%\..\star.zip /f
clover80.exe zip %base%\..\star.zip %base%\
Expand Down

0 comments on commit 981ac83

Please sign in to comment.