@@ -151,30 +151,7 @@ func (s *SESSION) GoDownsRoutine(wid int, provider *Provider, item *segmentChanI
151151
152152 // check cache before download
153153 if cacheON && cache .ReadCache (item ) > 0 {
154- // item has been read from cache - set flags as if downloaded
155- // Mark all providers in this group as having the article
156- /* disabled, this looks wrong
157- flagProviderCache:
158- for pid, prov := range s.providerList {
159- if prov.Group != provider.Group {
160- continue flagProviderCache
161- }
162- item.mux.Lock()
163- item.availableOn[pid] = true
164- delete(item.missingOn, pid)
165- item.mux.Unlock()
166- }
167- */
168- item .mux .Lock ()
169- item .flagCache = true
170- item .flagisDL = true
171- item .flaginDL = false
172- item .flaginDLMEM = false
173- item .mux .Unlock ()
174-
175- // Free memory slot immediately since no actual download happens
176- //who := fmt.Sprintf("DR=%d@'%s'#'%s' seg.Id='%s'", wid, provider.Name, provider.Group, item.segment.Id)
177- //memlim.MemReturn(who+":cacheRead", item)
154+ dlog (cfg .opt .DebugDR , "GoDownsRoutine: cache hit seg.Id='%s' @ '%s'#'%s'" , item .segment .Id , provider .Name , provider .Group )
178155 return 920 , nil
179156 }
180157 start := time .Now () // start time for this routine
@@ -264,10 +241,6 @@ func (s *SESSION) GoDownsRoutine(wid int, provider *Provider, item *segmentChanI
264241 // pass item to cache.
265242 dlog (cfg .opt .DebugWorker , "DEBUG GoDownsRoutine CMD_ARTICLE: reached cache.Add2Cache seg.Id='%s' @ '%s'#'%s'" , item .segment .Id , provider .Name , provider .Group )
266243
267- // Release memory BEFORE adding to cache to prevent deadlock
268- // Cache writer will not release memory since we already did it here
269- //memlim.MemReturn("GoDownsRoutine:beforeCache", item)
270-
271244 cache .Add2Cache (item )
272245 // pass to ParkConn
273246
0 commit comments