private static Task ObserveDiscardedTask(FutureIndexBatch source)
{
return source.Task.ContinueWith(task =>
{
if (task.Exception != null)
{
log.WarnException("Error happened on discarded future work batch", task.Exception);
}
else
{
log.Warn("WASTE: Discarding future work item without using it, to reduce memory usage");
}
});
}