private async Task ReportActivityAsync() { var utcNow = DateTime.UtcNow; if (_nextReportDateUtc.HasValue && utcNow >= _nextReportDateUtc.Value) { var reportActivityRequest = new ReportActivityRequest(utcNow); var nextReportInterval = await _instanceProxy.ReportActivityAsync(_instanceId.Value, reportActivityRequest); _nextReportDateUtc = utcNow.Add(nextReportInterval); } }
public async Task <TimeSpan> ReportActivityAsync(ReportActivityRequest request) => (await _context.ReportActivityAsync(new ReportActivity(request.LastActiveUtc), _cancellation)).NextReportTime;
public Task <TimeSpan> ReportActivityAsync(Guid instanceId, ReportActivityRequest request) => GetProxy(instanceId).ReportActivityAsync(request);