def clean_messages(self): now = int(time.time()) for k in self.crawl_message.keys(): if now - 3600 > self.crawl_message[k]['time']: self.crawl_message.pop(k) clean_twisted_observers()
def clean_messages(self): clean_twisted_observers()
# from dispersy.discovery.community import DiscoveryCommunity from Tribler.dispersy.dispersy import Dispersy from Tribler.dispersy.endpoint import StandaloneEndpoint from Tribler.dispersy.exception import CommunityNotFoundException from twisted.application.service import IServiceMaker, MultiService from twisted.conch import manhole_tap from twisted.internet import reactor from twisted.plugin import IPlugin from twisted.python import usage from twisted.python.log import msg from twisted.python.threadable import isInIOThread from zope.interface import implements from Tribler.community.bartercast4.community import BarterCommunityCrawler from Tribler.dispersy.tool.clean_observers import clean_twisted_observers clean_twisted_observers() class BartercastCrawler(Dispersy): def __init__(self, endpoint, working_directory, silent=False, crypto=NoVerifyCrypto()): super(BartercastCrawler, self).__init__(endpoint, working_directory, u":memory:", crypto) # location of persistent storage self._persistent_storage_filename = os.path.join( working_directory, "persistent-storage.data") self._silent = silent