MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / StartBackupMonitor

Method StartBackupMonitor

internal/ui/components/app.go:747–775  ·  view source on GitHub ↗

StartBackupMonitor starts monitoring a backup task.

(upid, nodeName string, vmid int)

Source from the content-addressed store, hash-verified

745
746// StartBackupMonitor starts monitoring a backup task.
747func (a *App) StartBackupMonitor(upid, nodeName string, vmid int) {
748 // Resolve client
749 var client *api.Client
750 if a.isGroupMode {
751 // Find node in global state to get source profile
752 var node *api.Node
753 for _, n := range models.GlobalState.OriginalNodes {
754 if n != nil && n.Name == nodeName {
755 node = n
756 break
757 }
758 }
759 if node != nil {
760 c, err := a.getClientForNode(node)
761 if err == nil {
762 client = c
763 }
764 }
765 } else {
766 client = a.client
767 }
768
769 if client == nil {
770 a.logger.Error("Could not resolve client for backup monitoring task %s (node %s)", upid, nodeName)
771 return
772 }
773
774 a.poller.AddTask(client, upid, nodeName, vmid)
775}
776
777// GetActiveBackupsForVM returns a list of active backups for a specific VM.
778func (a *App) GetActiveBackupsForVM(vmid int) []*taskpoller.TaskInfo {

Callers 1

trackBackupTaskMethod · 0.80

Calls 3

getClientForNodeMethod · 0.95
AddTaskMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected