Skip to content

Commit 906a7d7

Browse files
committed
tweaks
1 parent 0b50ab7 commit 906a7d7

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/WorkflowCore/Services/GreyList.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ public class GreyList : IGreyList, IDisposable
1111
private readonly Timer _cycleTimer;
1212
private readonly ConcurrentDictionary<string, DateTime> _list;
1313
private readonly ILogger _logger;
14-
private const int CYCLE_TIME = 600;
14+
private const int CYCLE_TIME = 30;
15+
private const int TTL = 5;
1516

1617
public GreyList(ILoggerFactory loggerFactory)
1718
{
1819
_logger = loggerFactory.CreateLogger<GreyList>();
1920
_list = new ConcurrentDictionary<string, DateTime>();
20-
_cycleTimer = new Timer(new TimerCallback(Cycle), null, TimeSpan.FromSeconds(CYCLE_TIME), TimeSpan.FromSeconds(CYCLE_TIME));
21+
_cycleTimer = new Timer(new TimerCallback(Cycle), null, TimeSpan.FromMinutes(CYCLE_TIME), TimeSpan.FromMinutes(CYCLE_TIME));
2122
}
2223

2324
public void Add(string id)
@@ -30,7 +31,7 @@ public bool Contains(string id)
3031
if (!_list.TryGetValue(id, out var start))
3132
return false;
3233

33-
var result = start > (DateTime.Now.AddMinutes(-2));
34+
var result = start > (DateTime.Now.AddMinutes(-1 * TTL));
3435

3536
if (!result)
3637
_list.TryRemove(id, out var _);

src/WorkflowCore/WorkflowCore.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1616
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
1717
<Description>Workflow Core is a light weight workflow engine targeting .NET Standard.</Description>
18-
<Version>3.2.1</Version>
19-
<AssemblyVersion>3.2.1.0</AssemblyVersion>
20-
<FileVersion>3.2.1.0</FileVersion>
18+
<Version>3.2.2</Version>
19+
<AssemblyVersion>3.2.2.0</AssemblyVersion>
20+
<FileVersion>3.2.2.0</FileVersion>
2121
<PackageReleaseNotes></PackageReleaseNotes>
2222
<PackageIconUrl>https://github.com/danielgerlag/workflow-core/raw/master/src/logo.png</PackageIconUrl>
23-
<PackageVersion>3.2.1</PackageVersion>
23+
<PackageVersion>3.2.2</PackageVersion>
2424
</PropertyGroup>
2525

2626
<ItemGroup>

0 commit comments

Comments
 (0)