Skip to content

Commit

Permalink
Fix hangfire options
Browse files Browse the repository at this point in the history
  • Loading branch information
stanriders committed Jul 1, 2024
1 parent 9662b9c commit a2c13c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backend/Mutualify/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,8 @@ static Task UnauthorizedRedirect(RedirectContext<CookieAuthenticationOptions> co
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseSerilogLogProvider()
.UsePostgreSqlStorage(options =>
{
options.UseConnectionFactory(new NpgsqlConnectionFactory(connectionString.ConnectionString,
new PostgreSqlStorageOptions { UseSlidingInvisibilityTimeout = true }));
});
.UsePostgreSqlStorage(options => { options.UseNpgsqlConnection(connectionString.ConnectionString); },
new PostgreSqlStorageOptions { UseSlidingInvisibilityTimeout = true });
});

builder.Services.AddHangfireServer(options =>
Expand Down
2 changes: 2 additions & 0 deletions backend/Mutualify/Services/UsersService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ public async Task Update(int userId)
if (token is not null && token.ExpiresOn <= DateTime.UtcNow.AddDays(1))
{
// refresh close-to-expiration tokens
_logger.LogInformation("User {UserId} tokens are close to expiration ({ExpiresOn} <= {Threshold}), updating...", token.UserId, token.ExpiresOn, DateTime.UtcNow.AddDays(1));

await RefreshToken(token);
}

Expand Down

0 comments on commit a2c13c7

Please sign in to comment.