Browse Source

Add TickerQ dashboard integration to demo app

pull/23802/head
maliming 4 months ago
parent
commit
2750b3a68b
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 3
      .github/workflows/build-and-test.yml
  2. 11
      modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.TickerQ/DemoAppTickerQModule.cs
  3. 2
      modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.TickerQ/Program.cs
  4. 13
      modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.TickerQ/Properties/launchSettings.json
  5. 1
      modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.TickerQ/Volo.Abp.BackgroundJobs.DemoApp.TickerQ.csproj

3
.github/workflows/build-and-test.yml

@ -52,6 +52,9 @@ jobs:
if: ${{ !github.event.pull_request.draft }}
steps:
- uses: jlumbroso/free-disk-space@main
- uses: PSModule/install-powershell@v1
with:
Version: latest
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@master
with:

11
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.TickerQ/DemoAppTickerQModule.cs

@ -1,8 +1,8 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using TickerQ.Dashboard.DependencyInjection;
using TickerQ.DependencyInjection;
using TickerQ.Utilities.Interfaces.Managers;
using TickerQ.Utilities.Models.Ticker;
@ -31,6 +31,13 @@ public class DemoAppTickerQModule : AbpModule
context.Services.AddTickerQ(options =>
{
options.UpdateMissedJobCheckDelay(TimeSpan.FromSeconds(30));
options.AddDashboard(x =>
{
x.BasePath = "/tickerq-dashboard";
x.UseHostAuthentication = true;
});
});
Configure<AbpBackgroundJobsTickerQOptions>(options =>
@ -62,7 +69,7 @@ public class DemoAppTickerQModule : AbpModule
{
endpoints.MapGet("/", async httpContext =>
{
await httpContext.Response.WriteAsync("Hello TickerQ!");
httpContext.Response.Redirect("/tickerq-dashboard", true);
});
});

2
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.TickerQ/Program.cs

@ -10,7 +10,7 @@ public class Program
public static async Task Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.Host.AddAppSettingsSecretsJson().UseAutofac();
builder.Host.UseAutofac();
await builder.AddApplicationAsync<DemoAppTickerQModule>();
var app = builder.Build();
await app.InitializeApplicationAsync();

13
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.TickerQ/Properties/launchSettings.json

@ -0,0 +1,13 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"Volo.Abp.BackgroundJobs.DemoApp.TickerQ": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

1
modules/background-jobs/app/Volo.Abp.BackgroundJobs.DemoApp.TickerQ/Volo.Abp.BackgroundJobs.DemoApp.TickerQ.csproj

@ -11,6 +11,7 @@
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.BackgroundWorkers.TickerQ\Volo.Abp.BackgroundWorkers.TickerQ.csproj" />
<ProjectReference Include="..\Volo.Abp.BackgroundJobs.DemoApp.Shared\Volo.Abp.BackgroundJobs.DemoApp.Shared.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore\Volo.Abp.AspNetCore.csproj" />
<PackageReference Include="TickerQ.Dashboard" />
</ItemGroup>
<ItemGroup>

Loading…
Cancel
Save