private void DeleteExpiredBroadcasted(CloudTableEvent evt, uint256 hash) { if (evt.AddedEntity != null) { if (DateTimeOffset.UtcNow - evt.AddedEntity.Timestamp > TimeSpan.FromHours(24.0)) { ListenerTrace.Verbose("Cleaning expired broadcasted " + hash); DeleteBroadcasted(evt.AddedEntity, hash); } } }
private static CloudTableEvent ToCloudTableEvent(BrokeredMessage message) { if (message == null) { return(null); } CloudTableEvent evt = new CloudTableEvent(); evt.Addition = message.Properties["Addition"].ToString() == "true"; if (evt.Addition) { evt.AddedEntity = ListenableCloudTable.ToTableEntity(message); } evt.PartitionKey = evt.PartitionKey; evt.RowKey = message.Properties["RowKey"].ToString(); return(evt); }