Skip to content

Commit

Permalink
Merge branch 'release/3.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
eXpl0it3r committed Apr 30, 2024
2 parents 8943cb5 + 9b88a89 commit f1f23b2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
16 changes: 8 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ platform: Any CPU
configuration: Release

build:
parallel: true
parallel: true
project: source/Jobbr.Execution.Forked.sln

test_script:
- vstest.console /logger:Appveyor "C:\projects\jobbr-execution-forked\source\Jobbr.Server.ForkedExecution.Tests\bin\Release\net6.0\Jobbr.Server.ForkedExecution.Tests.dll" "C:\projects\jobbr-execution-forked\source\submodules\jobbr-runtime\source\Jobbr.Runtime.Tests\bin\Release\net6.0\Jobbr.Runtime.Tests.dll"

Expand All @@ -40,9 +40,9 @@ after_build:
- cmd: appveyor PushArtifact "Jobbr.Runtime.ForkedExecution.%GitVersion_SemVer%.nupkg"

deploy:
- provider: NuGet
server: https://nuget.org
api_key:
secure: anKLNUxe1pn63rrNVCigoQVfA/fWML9gEpE1UHRLK/LDmQX4SM9WwzDx0kliHKWC
on:
appveyor_repo_tag: true
- provider: NuGet
server: https://nuget.org
api_key:
secure: 60SMVZkhtzWAeH6Mp7DT1YZlZGGG8jwOEXMH0oRhX1iQLBejg1TpaDxgN6i0RisX
on:
appveyor_repo_tag: true
20 changes: 16 additions & 4 deletions source/Jobbr.Runtime.ForkedExecution/ForkedRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public ForkedRuntime(ILoggerFactory loggerFactory, RuntimeConfiguration runtimeC
_coreRuntime = new CoreRuntime(loggerFactory, runtimeConfiguration);

// Wire Events to publish status
_coreRuntime.Initializing += (sender, args) => _forkedExecutionRestClient.PublishState(JobRunStates.Initializing);
_coreRuntime.Starting += (sender, args) => _forkedExecutionRestClient.PublishState(JobRunStates.Processing);
_coreRuntime.Initializing += (sender, args) => HandleEvent("Initializing", () => _forkedExecutionRestClient.PublishState(JobRunStates.Initializing));
_coreRuntime.Starting += (sender, args) => HandleEvent("Starting", () => _forkedExecutionRestClient.PublishState(JobRunStates.Processing));

_coreRuntime.Ended += CoreRuntimeOnEnded;
_coreRuntime.Ended += (sender, args) => HandleEvent("Ended", () => CoreRuntimeOnEnded(args));
}

/// <summary>
Expand Down Expand Up @@ -123,7 +123,7 @@ private void CurrentDomainOnUnhandledException(object sender, UnhandledException
_logger.LogError((Exception)unhandledExceptionEventArgs.ExceptionObject, "Unhandled Infrastructure Exception in Jobbr-Runtime. Please contact the developers!");
}

private void CoreRuntimeOnEnded(object sender, ExecutionEndedEventArgs executionEndedEventArgs)
private void CoreRuntimeOnEnded(ExecutionEndedEventArgs executionEndedEventArgs)
{
if (!executionEndedEventArgs.Succeeded)
{
Expand All @@ -144,5 +144,17 @@ private void CoreRuntimeOnEnded(object sender, ExecutionEndedEventArgs execution

_forkedExecutionRestClient.PublishState(executionEndedEventArgs.Succeeded ? JobRunStates.Completed : JobRunStates.Failed);
}

private void HandleEvent(string eventName, Action eventHandler)
{
try
{
eventHandler();
}
catch (Exception e)
{
_logger.LogError(e, $"Error while handling event {eventName}.");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</PropertyGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.16" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Jobbr.ComponentModel.ArtefactStorage" Version="3.0.0" />
Expand Down

0 comments on commit f1f23b2

Please sign in to comment.