Skip to content

Commit

Permalink
Add IGlobalConfiguration.UseMaxArgumentSizeToRender method
Browse files Browse the repository at this point in the history
Closes #1295
  • Loading branch information
odinserj committed Jan 15, 2021
1 parent bc73c78 commit 1fdbcbb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Hangfire.Core/Dashboard/JobMethodCallRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Hangfire.Dashboard
internal static class JobMethodCallRenderer
{
// Should not be converted to "readonly" to support https://github.com/HangfireIO/Hangfire/issues/1295
private static int MaxArgumentToRenderSize = 4096;
internal static int MaxArgumentToRenderSize = 4096;

public static NonEscapedString Render(Job job)
{
Expand Down
11 changes: 11 additions & 0 deletions src/Hangfire.Core/GlobalConfigurationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,17 @@ public static IGlobalConfiguration UseMaxLinesInExceptionDetails(
return configuration;
}

public static IGlobalConfiguration UseMaxArgumentSizeToRender(
[NotNull] this IGlobalConfiguration configuration,
int size)
{
if (configuration == null) throw new ArgumentNullException(nameof(configuration));
if (size < 0) throw new ArgumentOutOfRangeException(nameof(size), "Must be a positive value");

JobMethodCallRenderer.MaxArgumentToRenderSize = size;
return configuration;
}

[EditorBrowsable(EditorBrowsableState.Never)]
public static IGlobalConfiguration<T> Use<T>(
[NotNull] this IGlobalConfiguration configuration, T entry,
Expand Down

0 comments on commit 1fdbcbb

Please sign in to comment.