Compare commits
4 commits
v2_Improve
...
v2
Author | SHA1 | Date | |
---|---|---|---|
a4080cc1b1 | |||
4f5a4913d7 | |||
c340e48f02 | |||
ccec79cca7 |
|
@ -1,9 +1,9 @@
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["Moonlight/Moonlight.csproj", "Moonlight/"]
|
||||
|
|
|
@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore;
|
|||
using MoonCore.Abstractions;
|
||||
using MoonCore.Attributes;
|
||||
using MoonCore.Exceptions;
|
||||
using MoonCore.Helpers;
|
||||
using MoonCore.Services;
|
||||
using Moonlight.Core.Configuration;
|
||||
using Moonlight.Core.Database.Entities;
|
||||
|
@ -22,6 +23,8 @@ public class ServerService
|
|||
public ServerConsoleService Console => ServiceProvider.GetRequiredService<ServerConsoleService>();
|
||||
public ServerBackupService Backup => ServiceProvider.GetRequiredService<ServerBackupService>();
|
||||
public ServerScheduleService Schedule => ServiceProvider.GetRequiredService<ServerScheduleService>();
|
||||
|
||||
public NodeService NodeService => ServiceProvider.GetRequiredService<NodeService>();
|
||||
|
||||
private readonly IServiceProvider ServiceProvider;
|
||||
|
||||
|
@ -74,6 +77,19 @@ public class ServerService
|
|||
// Load node
|
||||
var node = nodeRepo.Get().First(x => x.Id == form.Node.Id);
|
||||
|
||||
// Check if node is available
|
||||
try
|
||||
{
|
||||
await NodeService.GetStatus(node);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Warn($"Could not establish to the node with the id {node.Id}");
|
||||
Logger.Warn(e);
|
||||
|
||||
throw new DisplayException($"Could not establish connection to the node: {e.Message}");
|
||||
}
|
||||
|
||||
// Load user
|
||||
var user = userRepo.Get().First(x => x.Id == form.Owner.Id);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
|
|
Loading…
Reference in a new issue