MCPcopy Create free account
hub / github.com/Unpackerr/unpackerr / retrieveAppQueues

Method retrieveAppQueues

pkg/unpackerr/apps.go:102–133  ·  view source on GitHub ↗

retrieveAppQueues polls all the starr app queues. At the same time. Then calls the check methods to scan their queue contents for changes.

(now time.Time)

Source from the content-addressed store, hash-verified

100// retrieveAppQueues polls all the starr app queues. At the same time.
101// Then calls the check methods to scan their queue contents for changes.
102func (u *Unpackerr) retrieveAppQueues(now time.Time) {
103 wait := sync.WaitGroup{}
104 wait.Add(len(u.Lidarr) + len(u.Radarr) + len(u.Readarr) + len(u.Sonarr) + len(u.Whisparr))
105 // Run each app's getQueue method in a go routine as a waitgroup.
106 for _, server := range u.Lidarr {
107 u.workChan <- []func(){func() { u.getLidarrQueue(server, now) }, wait.Done}
108 }
109
110 for _, server := range u.Radarr {
111 u.workChan <- []func(){func() { u.getRadarrQueue(server, now) }, wait.Done}
112 }
113
114 for _, server := range u.Readarr {
115 u.workChan <- []func(){func() { u.getReadarrQueue(server, now) }, wait.Done}
116 }
117
118 for _, server := range u.Sonarr {
119 u.workChan <- []func(){func() { u.getSonarrQueue(server, now) }, wait.Done}
120 }
121
122 for _, server := range u.Whisparr {
123 u.workChan <- []func(){func() { u.getWhisparrQueue(server, now) }, wait.Done}
124 }
125
126 wait.Wait()
127 // These are not thread safe because they call saveCompletedDownload.
128 u.checkLidarrQueue(now)
129 u.checkRadarrQueue(now)
130 u.checkReadarrQueue(now)
131 u.checkSonarrQueue(now)
132 u.checkWhisparrQueue(now)
133}
134
135// validateApps is broken-out into this file to make adding new apps easier.
136func (u *Unpackerr) validateApps() error {

Callers 1

RunMethod · 0.95

Calls 11

getLidarrQueueMethod · 0.95
getRadarrQueueMethod · 0.95
getReadarrQueueMethod · 0.95
getSonarrQueueMethod · 0.95
getWhisparrQueueMethod · 0.95
checkLidarrQueueMethod · 0.95
checkRadarrQueueMethod · 0.95
checkReadarrQueueMethod · 0.95
checkSonarrQueueMethod · 0.95
checkWhisparrQueueMethod · 0.95
AddMethod · 0.80

Tested by

no test coverage detected