public async Task <int> CompensateAsync(List <string> ids, CompensateType type) { if (ids == null || ids.Count == 0) { return(0); } int count = 0; var fullName = this.GetPrimaryKeyString(); foreach (var id in ids) { if (type.Equals(CompensateType.Clear.ToString())) { if (await this.ServiceProvider.GetRequiredServiceByName <IElasticsearchStorage>(fullName).ClearAsync(id)) { count++; } } else { if (await this.ServiceProvider.GetRequiredServiceByName <IElasticsearchStorage>(fullName).RefreshAsync(id)) { count++; } } } return(count); }
public async Task WriteAsync(string id, CompensateType type) { reminder = await this.RegisterOrUpdateReminder($"{id}|{type.ToString()}", TimeSpan.FromSeconds(30), TimeSpan.FromMinutes(1)); }