Skip to content

Commit

Permalink
AAdd hangfire logs, DisableConcurrentExecution
Browse files Browse the repository at this point in the history
  • Loading branch information
stanriders committed Jul 1, 2024
1 parent 03938a2 commit 9662b9c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/Mutualify/Jobs/UserRelationsUpdateJob.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Hangfire.Server;
using Hangfire;
using Hangfire.Server;
using Microsoft.EntityFrameworkCore;
using Mutualify.Database;
using Mutualify.Jobs.Interfaces;
Expand Down Expand Up @@ -26,6 +27,7 @@ public UserRelationsUpdateJob(IUsersService usersService, IRelationsService rela
_databaseContext = databaseContext;
}

[DisableConcurrentExecution(timeoutInSeconds: 60 * 60 * 24)]
public async Task Run(PerformContext context, CancellationToken token)
{
var jobId = context.BackgroundJob.Id;
Expand Down
2 changes: 2 additions & 0 deletions backend/Mutualify/Jobs/UserUpdateJob.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

using Hangfire;
using Hangfire.Server;
using Microsoft.EntityFrameworkCore;
using Mutualify.Database;
Expand All @@ -25,6 +26,7 @@ public UserUpdateJob(IUsersService usersService, ILogger<UserUpdateJob> logger,
_databaseContext = databaseContext;
}

[DisableConcurrentExecution(timeoutInSeconds: 60 * 60 * 24)]
public async Task Run(PerformContext context, CancellationToken token)
{
var jobId = context.BackgroundJob.Id;
Expand Down
1 change: 1 addition & 0 deletions backend/Mutualify/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ static Task UnauthorizedRedirect(RedirectContext<CookieAuthenticationOptions> co
x.SetDataCompatibilityLevel(CompatibilityLevel.Version_180)
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseSerilogLogProvider()
.UsePostgreSqlStorage(options =>
{
options.UseConnectionFactory(new NpgsqlConnectionFactory(connectionString.ConnectionString,
Expand Down

0 comments on commit 9662b9c

Please sign in to comment.