private async Task _queueWebsubDelivery(string userId, int collectionItem, string objectId) { foreach (var sub in await _context.WebsubSubscriptions.Where(a => a.UserId == userId && a.Expiry > DateTime.Now).ToListAsync()) { _context.EventQueue.Add( DeliverToWebSubTask.Make(new DeliverToWebSubData { CollectionItem = collectionItem, ObjectId = objectId, SourceUserId = userId, Subscription = sub.Id })); } }
private async Task _queueWebsubDelivery(string userId, int collectionItem, string objectId) { var actor = await _store.GetEntity(userId, false); foreach (var sub in await(_connection.QueryAsync <WebsubSubscription>("select * from \"WebsubSubscriptions\" where \"UserId\" = @UserId and \"Expiry\" > @Expiry", new { UserId = actor.DbId, Expiry = DateTime.Now }))) { await DeliverToWebSubTask.Make(new DeliverToWebSubData { CollectionItem = collectionItem, ObjectId = objectId, SourceUserId = userId, Subscription = sub.Id }, _connection); } }