Compare commits

..

No commits in common. "8ac429efef917403f5936ad520a846df6876d4db" and "addec01dc82437b4161710740947289d5594f770" have entirely different histories.

7 changed files with 13 additions and 59 deletions

View File

@ -11,8 +11,6 @@ using JiShe.CollectBus.FreeSql;
using System; using System;
using Volo.Abp.AspNetCore.Mvc.AntiForgery; using Volo.Abp.AspNetCore.Mvc.AntiForgery;
using JiShe.CollectBus.FreeRedisProvider; using JiShe.CollectBus.FreeRedisProvider;
using JiShe.CollectBus.Workers;
using Volo.Abp.BackgroundWorkers.Hangfire;
namespace JiShe.CollectBus; namespace JiShe.CollectBus;
@ -21,7 +19,7 @@ namespace JiShe.CollectBus;
typeof(CollectBusApplicationContractsModule), typeof(CollectBusApplicationContractsModule),
typeof(AbpDddApplicationModule), typeof(AbpDddApplicationModule),
typeof(AbpAutoMapperModule), typeof(AbpAutoMapperModule),
typeof(AbpBackgroundWorkersHangfireModule), typeof(AbpBackgroundWorkersModule),
typeof(FreeRedisProviderModule), typeof(FreeRedisProviderModule),
typeof(CollectBusFreeSqlModule) typeof(CollectBusFreeSqlModule)
)] )]
@ -42,7 +40,7 @@ public class CollectBusApplicationModule : AbpModule
}); });
} }
public override void OnApplicationInitialization( public override async Task OnApplicationInitializationAsync(
ApplicationInitializationContext context) ApplicationInitializationContext context)
{ {
var assembly = Assembly.GetExecutingAssembly(); var assembly = Assembly.GetExecutingAssembly();
@ -50,7 +48,7 @@ public class CollectBusApplicationModule : AbpModule
foreach (var type in types) foreach (var type in types)
{ {
context.AddBackgroundWorkerAsync(type); await context.AddBackgroundWorkerAsync(type);
} }
} }

View File

@ -1,10 +1,8 @@
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Hangfire;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Volo.Abp.BackgroundWorkers.Hangfire; using Volo.Abp.BackgroundWorkers.Hangfire;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Uow;
namespace JiShe.CollectBus.Workers namespace JiShe.CollectBus.Workers
{ {
@ -19,18 +17,13 @@ namespace JiShe.CollectBus.Workers
public EpiCollectWorker(ILogger<EpiCollectWorker> logger) public EpiCollectWorker(ILogger<EpiCollectWorker> logger)
{ {
_logger = logger; _logger = logger;
RecurringJobId = nameof(EpiCollectWorker);
CronExpression = Cron.Daily();
} }
public override Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken()) public override Task DoWorkAsync(CancellationToken cancellationToken = new CancellationToken())
{ {
using (var uow = LazyServiceProvider.LazyGetRequiredService<IUnitOfWorkManager>().Begin()) _logger.LogError("Executed MyLogWorker..!");
{
Logger.LogInformation("Executed MyLogWorker..!");
return Task.CompletedTask; return Task.CompletedTask;
} }
} }
} }
}

View File

@ -8,11 +8,8 @@
<ItemGroup> <ItemGroup>
<Compile Remove="Abstractions\**" /> <Compile Remove="Abstractions\**" />
<Compile Remove="Interfaces\**" />
<EmbeddedResource Remove="Abstractions\**" /> <EmbeddedResource Remove="Abstractions\**" />
<EmbeddedResource Remove="Interfaces\**" />
<None Remove="Abstractions\**" /> <None Remove="Abstractions\**" />
<None Remove="Interfaces\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -27,4 +24,8 @@
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="8.3.3" /> <PackageReference Include="Volo.Abp.Ddd.Domain" Version="8.3.3" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\" />
</ItemGroup>
</Project> </Project>

View File

@ -20,10 +20,7 @@
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Localization\CollectBus\*.json" /> <EmbeddedResource Include="Localization\CollectBus\*.json" />
<Compile Remove="Caches\**" />
<Content Remove="Localization\CollectBus\*.json" /> <Content Remove="Localization\CollectBus\*.json" />
<EmbeddedResource Remove="Caches\**" />
<None Remove="Caches\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -31,4 +28,8 @@
<None Remove="JiShe.CollectBus.Domain.Shared.abppkg" /> <None Remove="JiShe.CollectBus.Domain.Shared.abppkg" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Caches\" />
</ItemGroup>
</Project> </Project>

View File

@ -1,34 +0,0 @@
using System;
using Microsoft.Extensions.Logging;
namespace JiShe.CollectBus.Loggers
{
public static class LoggerExtensions
{
public static void LogInfoToMongo(
this ILogger logger,
EventId eventId,
Exception? exception,
string? message,
params object?[] args)
{
}
public static void LogInfoToMongo(this ILogger logger)
{
}
private static void Log(
this ILogger logger,
LogLevel logLevel,
EventId eventId,
string? message,
params object?[] args)
{
}
}
}

View File

@ -26,8 +26,4 @@
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="8.3.3" /> <PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="8.3.3" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Loggers\" />
</ItemGroup>
</Project> </Project>

View File

@ -39,7 +39,6 @@ namespace JiShe.CollectBus.Host
public void Configure(IApplicationBuilder app, IHostApplicationLifetime lifetime) public void Configure(IApplicationBuilder app, IHostApplicationLifetime lifetime)
{ {
app.InitializeApplication(); app.InitializeApplication();
//await app.InitializeApplicationAsync();
} }
} }
} }