✨ Setup etcd helper and magic onion
This commit is contained in:
@@ -66,8 +66,8 @@ public class NotificationService(
|
||||
AccountId = account.Id,
|
||||
};
|
||||
|
||||
// db.NotificationPushSubscriptions.Add(subscription);
|
||||
// await db.SaveChangesAsync();
|
||||
db.NotificationPushSubscriptions.Add(subscription);
|
||||
await db.SaveChangesAsync();
|
||||
|
||||
return subscription;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class NotificationService(
|
||||
}
|
||||
|
||||
if (!isSilent)
|
||||
Console.WriteLine("Simulating notification delivery."); // _ = DeliveryNotification(notification);
|
||||
_ = DeliveryNotification(notification);
|
||||
|
||||
return notification;
|
||||
}
|
||||
@@ -134,10 +134,10 @@ public class NotificationService(
|
||||
var id = notifications.Where(n => n.ViewedAt == null).Select(n => n.Id).ToList();
|
||||
if (id.Count == 0) return;
|
||||
|
||||
// await db.Notifications
|
||||
// .Where(n => id.Contains(n.Id))
|
||||
// .ExecuteUpdateAsync(s => s.SetProperty(n => n.ViewedAt, now)
|
||||
// );
|
||||
await db.Notifications
|
||||
.Where(n => id.Contains(n.Id))
|
||||
.ExecuteUpdateAsync(s => s.SetProperty(n => n.ViewedAt, now)
|
||||
);
|
||||
}
|
||||
|
||||
public async Task BroadcastNotification(Notification notification, bool save = false)
|
||||
@@ -161,7 +161,7 @@ public class NotificationService(
|
||||
};
|
||||
return newNotification;
|
||||
}).ToList();
|
||||
// await db.BulkInsertAsync(notifications);
|
||||
await db.BulkInsertAsync(notifications);
|
||||
}
|
||||
|
||||
foreach (var account in accounts)
|
||||
|
||||
Reference in New Issue
Block a user