Skip to content

Commit

Permalink
Merge pull request #9 from COMP-1640-GRE/cuongphgch210011
Browse files Browse the repository at this point in the history
tmp
  • Loading branch information
cuongphgch210011 authored Apr 14, 2024
2 parents 68c79a1 + a9b6221 commit 8e4866b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 7 additions & 7 deletions DotnetGRPC/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using DotnetGRPC.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.OpenApi.Models;
// using Hangfire;
// using Hangfire.PostgreSql;
using Hangfire;
using Hangfire.PostgreSql;

using Microsoft.Extensions.Azure;
using Azure.Identity;
Expand Down Expand Up @@ -37,10 +37,10 @@
builder.Services.Configure<EmailSettings>(builder.Configuration.GetSection("EmailSettings"));

// Add Hangfire services
// builder.Services.AddHangfire(x =>
// x.UsePostgreSqlStorage(builder.Configuration.GetConnectionString("HangfireConnection")));
builder.Services.AddHangfire(x =>
x.UsePostgreSqlStorage(builder.Configuration.GetConnectionString("HangfireConnection")));

Check warning on line 41 in DotnetGRPC/Program.cs

View workflow job for this annotation

GitHub Actions / build

'PostgreSqlBootstrapperConfigurationExtensions.UsePostgreSqlStorage(IGlobalConfiguration, string)' is obsolete: 'Will be removed in 2.0. Please use UsePostgreSqlStorage(Action<PostgreSqlBootstrapperOptions>) overload.'

Check warning on line 41 in DotnetGRPC/Program.cs

View workflow job for this annotation

GitHub Actions / build

'PostgreSqlBootstrapperConfigurationExtensions.UsePostgreSqlStorage(IGlobalConfiguration, string)' is obsolete: 'Will be removed in 2.0. Please use UsePostgreSqlStorage(Action<PostgreSqlBootstrapperOptions>) overload.'

// builder.Services.AddHangfireServer();
builder.Services.AddHangfireServer();

builder.Services.AddGrpcSwagger();
builder.Services.AddSwaggerGen(c =>
Expand Down Expand Up @@ -79,9 +79,9 @@
DotnetGRPC.GlobalVariables.Blob.Secret = builder.Configuration["SPACES_SECRET"];

Check warning on line 79 in DotnetGRPC/Program.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference assignment.

Check warning on line 79 in DotnetGRPC/Program.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference assignment.
}

// app.UseHangfireServer();
app.UseHangfireServer();

Check warning on line 82 in DotnetGRPC/Program.cs

View workflow job for this annotation

GitHub Actions / build

'HangfireApplicationBuilderExtensions.UseHangfireServer(IApplicationBuilder, BackgroundJobServerOptions, IEnumerable<IBackgroundProcess>, JobStorage)' is obsolete: 'Please use IServiceCollection.AddHangfireServer extension method instead in the ConfigureServices method. Will be removed in 2.0.0.'

Check warning on line 82 in DotnetGRPC/Program.cs

View workflow job for this annotation

GitHub Actions / build

'HangfireApplicationBuilderExtensions.UseHangfireServer(IApplicationBuilder, BackgroundJobServerOptions, IEnumerable<IBackgroundProcess>, JobStorage)' is obsolete: 'Please use IServiceCollection.AddHangfireServer extension method instead in the ConfigureServices method. Will be removed in 2.0.0.'

// RecurringJob.AddOrUpdate<NotificationService>(service => service.SendNotifyPendingContribution(), Cron.Daily);
RecurringJob.AddOrUpdate<NotificationService>(service => service.SendNotifyPendingContribution(), Cron.Daily);

Check warning on line 84 in DotnetGRPC/Program.cs

View workflow job for this annotation

GitHub Actions / build

'RecurringJob.AddOrUpdate<T>(Expression<Func<T, Task>>, Func<string>, TimeZoneInfo, string)' is obsolete: 'Please use an overload with the explicit recurringJobId parameter and RecurringJobOptions instead. Will be removed in 2.0.0.'

Check warning on line 84 in DotnetGRPC/Program.cs

View workflow job for this annotation

GitHub Actions / build

'RecurringJob.AddOrUpdate<T>(Expression<Func<T, Task>>, Func<string>, TimeZoneInfo, string)' is obsolete: 'Please use an overload with the explicit recurringJobId parameter and RecurringJobOptions instead. Will be removed in 2.0.0.'

// Configure the HTTP request pipeline.
app.MapGrpcService<GreeterService>();
Expand Down
4 changes: 4 additions & 0 deletions DotnetGRPC/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"Protocols": "Http2"
}
},
"ConnectionStrings": {
"DefaultConnection": "Host=comp1640.postgres.database.azure.com;Database=production;Username=comp_1640_admin;Password=NpQT7m8dDr!FuWoG#&$xTpNS*enLPpbywhcJCCeB#7$JvYAsU&5#aWr6&9st&%^&HovS!3dV@rgBV&gU%p&8$h8#2Lp&eN@pv^^biaPVrBCCct6!FrPMfkmWa^&totVx;Pooling=true;MaxPoolSize=30;MinPoolSize=10;",
"HangfireConnection": "Host=comp1640.postgres.database.azure.com;Database=production;Username=comp_1640_admin;Password=NpQT7m8dDr!FuWoG#&$xTpNS*enLPpbywhcJCCeB#7$JvYAsU&5#aWr6&9st&%^&HovS!3dV@rgBV&gU%p&8$h8#2Lp&eN@pv^^biaPVrBCCct6!FrPMfkmWa^&totVx;"
},
"EmailSettings": {
"Host": "smtp.gmail.com",
"Port": 587,
Expand Down

0 comments on commit 8e4866b

Please sign in to comment.