Compare commits

...

3 Commits

Author SHA1 Message Date
1024721e0e 🐛 Fix realtime call somethings account missing profile 2025-05-31 02:52:19 +08:00
ed2e9571ab 🐛 Fix the cloud file deletion 2025-05-31 02:48:36 +08:00
6670c69fda 🐛 Add priority to chat notification 2025-05-31 02:46:35 +08:00
4 changed files with 7 additions and 7 deletions

View File

@@ -1,4 +1,3 @@
using DysonNetwork.Sphere.Account;
using DysonNetwork.Sphere.Storage;
using Microsoft.EntityFrameworkCore;
using NodaTime;
@@ -41,6 +40,8 @@ public class ChatRoomService(AppDatabase db, ICacheService cache)
if (member is not null) return member;
member = await db.ChatMembers
.Include(m => m.Account)
.ThenInclude(m => m.Profile)
.Where(m => m.AccountId == accountId && m.ChatRoomId == chatRoomId)
.FirstOrDefaultAsync();

View File

@@ -84,7 +84,8 @@ public class ChatService(
["images"] = message.Attachments
.Where(a => a.MimeType != null && a.MimeType.StartsWith("image"))
.Select(a => a.Id).ToList()
}
},
Priority = 10,
};
List<Account.Account> accountsToNotify = [];

View File

@@ -105,7 +105,7 @@ public class RealtimeCallController(
if (realtime is LivekitRealtimeService livekitService)
{
var roomParticipants = await livekitService.GetRoomParticipantsAsync(ongoingCall.SessionId);
participants = new List<CallParticipant>();
participants = [];
foreach (var p in roomParticipants)
{

View File

@@ -541,7 +541,7 @@ public class CloudFileUnusedRecyclingJob(AppDatabase db, FileService fs, ILogger
var files = await db.Files
.Where(f =>
(f.ExpiredAt == null && f.UsedCount == 0 && f.CreatedAt < cutoff) ||
(f.ExpiredAt != null && f.ExpiredAt >= now)
(f.ExpiredAt != null && now >= f.ExpiredAt)
)
.ToListAsync();
@@ -573,10 +573,8 @@ public class CloudFileUnusedRecyclingJob(AppDatabase db, FileService fs, ILogger
.ToDictionary(grouping => grouping.Key!, grouping => grouping.ToList());
// Delete files by remote storage
foreach (var group in filesToDelete)
foreach (var group in filesToDelete.Where(group => !string.IsNullOrEmpty(group.Key)))
{
if (string.IsNullOrEmpty(group.Key)) continue;
try
{
var dest = fs.GetRemoteStorageConfig(group.Key);