Memory optimized the FLUTE
This commit is contained in:
parent
40c2ac21b6
commit
c4a4887a81
@ -142,27 +142,24 @@ namespace skyscraper8.DvbNip
|
||||
|
||||
private void TryPruneCache()
|
||||
{
|
||||
|
||||
/*
|
||||
DateTime now = DateTime.Now;
|
||||
List<FluteListener> staleListeners = flutes.Where(x => x.LastTouched != DateTime.MinValue)
|
||||
.Where(x => x.FileAssociation != null)
|
||||
.Where(x => (now - x.LastTouched).TotalMinutes >= 1.0)
|
||||
.Where(x => DvbNipUtilities.IsContinuousFileType(x.FileAssociation))
|
||||
List<KeyValuePair<Tuple<IPAddress, ushort, ulong, ulong>, FluteListener>> staleListeners = flutes.Where(x => x.Value.LastTouched != DateTime.MinValue)
|
||||
.Where(x => x.Value.FileAssociation != null)
|
||||
.Where(x => (now - x.Value.LastTouched).TotalMinutes >= 1.0)
|
||||
.Where(x => DvbNipUtilities.IsContinuousFileType(x.Value.FileAssociation))
|
||||
.ToList();
|
||||
if (staleListeners.Count > 0)
|
||||
{
|
||||
int prevItems = flutes.Count;
|
||||
foreach (FluteListener staleListener in staleListeners)
|
||||
foreach (KeyValuePair<Tuple<IPAddress, ushort, ulong, ulong>, FluteListener> staleListener in
|
||||
staleListeners)
|
||||
{
|
||||
staleListener.Disabled = true;
|
||||
flutes.Remove(staleListener);
|
||||
staleListener.Value.Disabled = true;
|
||||
flutes.Remove(staleListener.Key);
|
||||
}
|
||||
|
||||
int nowItems = flutes.Count;
|
||||
|
||||
logger.DebugFormat(String.Format("Removed {0} stale segments from FLUTE cache. Cache slimmed from {1} to {2} items.", staleListeners.Count,prevItems,nowItems));
|
||||
}*/
|
||||
logger.DebugFormat(String.Format("Removed {0} stale segments from FLUTE cache. Cache slimmed from {1} to {2} items.", staleListeners.Count, prevItems, nowItems));
|
||||
}
|
||||
}
|
||||
|
||||
private bool SetFileAssociations(FluteListener sourceListener, FDTInstanceType fdtAnnouncement)
|
||||
|
||||
@ -38,9 +38,9 @@ namespace skyscraper8.Ietf.FLUTE
|
||||
}
|
||||
if (FileAssociation != null)
|
||||
{
|
||||
return String.Format("IP={0}, Port={1}, TSI={2}, TOI={3}, Filename={4}", DestinationAddress, DestinationPort, DestinationTsi, DestinationToi, FileAssociation.ContentLocation);
|
||||
return String.Format("Filename={4}", DestinationAddress, DestinationPort, DestinationTsi, DestinationToi, FileAssociation.ContentLocation);
|
||||
}
|
||||
return String.Format("IP={0}, Port={1}, TSI={2}, TOI={3}", DestinationAddress, DestinationPort, DestinationTsi, DestinationToi);
|
||||
return String.Format("???");
|
||||
}
|
||||
|
||||
internal void PushPacket(LctFrame lctFrame)
|
||||
|
||||
@ -2476,11 +2476,15 @@ namespace skyscraper5.Skyscraper.Scraper
|
||||
{
|
||||
if (filetype != null)
|
||||
{
|
||||
string extension = Path.GetExtension(filetype.ContentLocation).ToLowerInvariant();
|
||||
if (!DvbNipUtilities.IsContinuousFileType(extension))
|
||||
{
|
||||
LogEvent(SkyscraperContextEvent.FluteFileProgress, String.Format("Filename={0}, {1}%", filetype.ContentLocation, progress));
|
||||
}
|
||||
if (!filetype.ContentLocation.Equals("urn:dvb:metadata:cs:NativeIPMulticastTransportObjectTypeCS:2023:bootstrap"))
|
||||
{
|
||||
string extension = Path.GetExtension(filetype.ContentLocation).ToLowerInvariant();
|
||||
if (!DvbNipUtilities.IsContinuousFileType(extension))
|
||||
{
|
||||
LogEvent(SkyscraperContextEvent.FluteFileProgress,
|
||||
String.Format("Filename={0}, {1}%", filetype.ContentLocation, progress));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user