From 99c3b61bd9a7657653a4002068bc63495b89ebac Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 24 Aug 2016 06:20:04 +0100 Subject: dont request a workjob if we can see there is nothing to do --- .../Region/CoreModules/Agent/Xfer/XferModule.cs | 30 +++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs index 41ce860..782e527 100644 --- a/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Xfer/XferModule.cs @@ -124,20 +124,26 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer double now = Util.GetTimeStampMS(); if(now - lastTimeTick > 1750.0) { - inTimeTick = true; - - //don't overload busy heartbeat - WorkManager.RunInThread( - delegate - { - transfersTimeTick(now); - expireFiles(now); + if(Transfers.Count == 0 && NewFiles.Count == 0) lastTimeTick = now; - inTimeTick = false; - }, - null, - "XferTimeTick"); + else + { + inTimeTick = true; + + //don't overload busy heartbeat + WorkManager.RunInThread( + delegate + { + transfersTimeTick(now); + expireFiles(now); + + lastTimeTick = now; + inTimeTick = false; + }, + null, + "XferTimeTick"); + } } } Monitor.Exit(timeTickLock); -- cgit v1.1