Fix: Bug refresh
This commit is contained in:
parent
f12f28a8bb
commit
6db556ed5c
2 changed files with 10 additions and 11 deletions
|
|
@ -57,24 +57,23 @@ export class TorrentTableComponent implements OnInit {
|
|||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
// Load initial disk space status
|
||||
this.torrentService.getDiskSpaceStatus().subscribe({
|
||||
next: (status) => {
|
||||
this.diskSpaceStatus = status;
|
||||
},
|
||||
});
|
||||
|
||||
this.torrentService.diskSpaceStatus$.subscribe((status) => {
|
||||
this.diskSpaceStatus = status;
|
||||
});
|
||||
|
||||
this.torrentService.update$.subscribe((result) => {
|
||||
this.torrents = result;
|
||||
});
|
||||
|
||||
this.torrentService.getList().subscribe({
|
||||
next: (result) => {
|
||||
this.torrents = result;
|
||||
|
||||
this.torrentService.update$.subscribe((result2) => {
|
||||
this.torrents = result2;
|
||||
});
|
||||
|
||||
this.torrentService.diskSpaceStatus$.subscribe((status) => {
|
||||
this.diskSpaceStatus = status;
|
||||
});
|
||||
},
|
||||
error: (err) => {
|
||||
this.error = err.error;
|
||||
|
|
|
|||
|
|
@ -48,8 +48,6 @@ public class DiskSpaceMonitor(ILogger<DiskSpaceMonitor> logger, IServiceProvider
|
|||
intervalMinutes = 1;
|
||||
}
|
||||
|
||||
await Task.Delay(TimeSpan.FromMinutes(intervalMinutes), stoppingToken);
|
||||
|
||||
var downloadPath = Settings.Get.DownloadClient.DownloadPath;
|
||||
logger.LogDebug($"Checking disk space for path: {downloadPath}");
|
||||
|
||||
|
|
@ -145,6 +143,8 @@ public class DiskSpaceMonitor(ILogger<DiskSpaceMonitor> logger, IServiceProvider
|
|||
_lastStatus = status;
|
||||
await remoteService.UpdateDiskSpaceStatus(status);
|
||||
}
|
||||
|
||||
await Task.Delay(TimeSpan.FromMinutes(intervalMinutes), stoppingToken);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue