Fix: Bug refresh

This commit is contained in:
destrodxbad 2025-11-14 18:04:41 +01:00
parent f12f28a8bb
commit 6db556ed5c
2 changed files with 10 additions and 11 deletions

View file

@ -57,24 +57,23 @@ export class TorrentTableComponent implements OnInit {
) {} ) {}
ngOnInit(): void { ngOnInit(): void {
// Load initial disk space status
this.torrentService.getDiskSpaceStatus().subscribe({ this.torrentService.getDiskSpaceStatus().subscribe({
next: (status) => { next: (status) => {
this.diskSpaceStatus = status; this.diskSpaceStatus = status;
}, },
}); });
this.torrentService.diskSpaceStatus$.subscribe((status) => {
this.diskSpaceStatus = status;
});
this.torrentService.update$.subscribe((result) => {
this.torrents = result;
});
this.torrentService.getList().subscribe({ this.torrentService.getList().subscribe({
next: (result) => { next: (result) => {
this.torrents = result; this.torrents = result;
this.torrentService.update$.subscribe((result2) => {
this.torrents = result2;
});
this.torrentService.diskSpaceStatus$.subscribe((status) => {
this.diskSpaceStatus = status;
});
}, },
error: (err) => { error: (err) => {
this.error = err.error; this.error = err.error;

View file

@ -48,8 +48,6 @@ public class DiskSpaceMonitor(ILogger<DiskSpaceMonitor> logger, IServiceProvider
intervalMinutes = 1; intervalMinutes = 1;
} }
await Task.Delay(TimeSpan.FromMinutes(intervalMinutes), stoppingToken);
var downloadPath = Settings.Get.DownloadClient.DownloadPath; var downloadPath = Settings.Get.DownloadClient.DownloadPath;
logger.LogDebug($"Checking disk space for path: {downloadPath}"); logger.LogDebug($"Checking disk space for path: {downloadPath}");
@ -145,6 +143,8 @@ public class DiskSpaceMonitor(ILogger<DiskSpaceMonitor> logger, IServiceProvider
_lastStatus = status; _lastStatus = status;
await remoteService.UpdateDiskSpaceStatus(status); await remoteService.UpdateDiskSpaceStatus(status);
} }
await Task.Delay(TimeSpan.FromMinutes(intervalMinutes), stoppingToken);
} }
catch (Exception ex) catch (Exception ex)
{ {