示例#1
0
文件: server.py 项目: JoshDaly/TrackM
 def _updateHits(self, contigHeaders, resultQueue, hitCache):
     II = ImportInterface(self.dbFileName,verbosity=-1)
     tmp = []
     while(True):
         current = resultQueue.get(block=True, timeout=None)
         #print "current capacity of resultQueue %d" % int(resultQueue.qsize())
         if current == None: 
             #print ">> DBG Current is None"
             II.importHits(contigHeaders, tmp)
             break
         else:
             tmp.append(current)
         
         #print ">> DBG Length of tmp is %d" % len(tmp)
          
         if len(tmp) >= hitCache: # set size limit of queue
             print ">> DBG " + datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S') + " Length of tmp is %d :: current capacity of resultQueue %d" % (len(tmp), int(resultQueue.qsize()))
             II.importHits(contigHeaders, tmp)
             tmp = []