Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions api/src/org/labkey/api/message/digest/MessageDigest.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,24 @@ public void addProvider(Provider provider)

public void sendMessageDigest() throws Exception
{
Date prev = getLastSuccessful();
Date current = new Date();

// get the start and end times to compute the message digest for
Date start = getStartRange(current, prev);
Date end = getEndRange(current, prev);

AtomicReference<Exception> ref = new AtomicReference<>();

// Issue 45978: Run in a background thread to better simulate being triggered by a timer
JobRunner.getDefault().execute(() -> {
try
{
Date prev = getLastSuccessful();
Date current = new Date();

// get the start and end times to compute the message digest for
Date start = getStartRange(current, prev);
Date end = getEndRange(current, prev);

for (Provider provider : _providers)
{
provider.sendDigestForAllContainers(start, end);
}
setLastSuccessful(end);
}
catch (Exception e)
{
Expand All @@ -98,8 +99,6 @@ public void sendMessageDigest() throws Exception
{
throw ref.get();
}

setLastSuccessful(end);
}

protected Date getStartRange(Date current, Date last)
Expand Down