8 Commits

Author SHA1 Message Date
7c22b4b9a7 Merge pull request '#7' (#28) from dev into main
Reviewed-on: http://git.lisoveliy.su/Lisoveliy/JOBot/pulls/28
2025-07-25 18:57:13 +02:00
9a7f178023 Merge pull request '7' (#27) from 7 into dev
All checks were successful
Publish JOBot on dev / Build and deploy (push) Successful in 25s
Reviewed-on: http://git.lisoveliy.su/Lisoveliy/JOBot/pulls/27
2025-07-25 18:45:27 +02:00
156ce579d4 Merge remote-tracking branch 'origin/7' into 7 2025-07-25 19:44:57 +03:00
0c6b8705ee fix: fixed production compose file 2025-07-25 19:44:51 +03:00
3085d5e778 Merge pull request '7' (#26) from 7 into dev
Some checks failed
Publish JOBot on dev / Build and deploy (push) Failing after 20s
Reviewed-on: http://git.lisoveliy.su/Lisoveliy/JOBot/pulls/26
2025-07-25 18:43:50 +02:00
8b1ead20c9 Merge branch 'dev' into 7 2025-07-25 18:43:45 +02:00
176cf194cd fix: fixed migration by lazy load of rabbitmq 2025-07-25 19:43:14 +03:00
17cec6dd64 fix: removed async in lock tasks 2025-07-25 19:04:38 +03:00
3 changed files with 22 additions and 17 deletions

View File

@@ -4,7 +4,7 @@ var builder = WebApplication.CreateBuilder(args);
var startup = new Startup(builder.Configuration);
await startup.ConfigureServices(builder.Services);
startup.ConfigureServices(builder.Services);
var app = builder.Build();
startup.Configure(app, app.Environment);

View File

@@ -12,29 +12,33 @@ public class Startup(IConfiguration configuration)
{
private IConfiguration Configuration { get; } = configuration;
public async Task ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services)
{
services.AddGrpc();
services.AddGrpcReflection();
services.AddControllers();
services.AddLogging();
var rabbitMqConnection = await new ConnectionFactory
{
HostName = "rabbitmq"
}.CreateConnectionAsync();
var channel = await rabbitMqConnection.CreateChannelAsync();
await channel.QueueDeclareAsync(
RabbitQueues.AuthQueue,
false,
false,
false,
arguments: null);
services.AddSingleton(channel);
services.AddDbContext<AppDbContext>(options =>
options.UseNpgsql(Configuration.GetConnectionString("PostgreSQL")));
services.AddSingleton<IChannel>(x =>
{
var rabbitMqConnection = new ConnectionFactory
{
HostName = "rabbitmq"
}.CreateConnectionAsync().Result;
var channel = rabbitMqConnection.CreateChannelAsync().Result;
channel.QueueDeclareAsync(
RabbitQueues.AuthQueue,
false,
false,
false,
arguments: null).Wait();
return channel;
});
services.Configure<HeadHunterConfig>(Configuration.GetSection(HeadHunterConfig.SectionName));
services.AddScoped<HeadHunterService>();

View File

@@ -46,3 +46,4 @@ networks:
volumes:
postgres_data:
rabbitmq_data: