示例#1
0
文件: capture.py 项目: klb3713/BYSJ
 def CaptureReview(self):
     start = time.time()
     print "[%s]Starting Capture Review !" %(datetime.now())
     
     while not self.thread_stop:
         api = ReviewApi.objects.first()
         if api:
             api_processor = ApiProcessor(api, key='review')
             api_processor.start()
             api.delete()
             self.sleep_count = 0
         else:
             self.sleep_count += 1
         if self.sleep_count == 7:
             print "[%s]All ReviewApi is processed!" %(datetime.now())
             self.thread_stop = True
         time.sleep(self.interval)
     print "CaptureReview Use Time: %s" % (time.time() - start)
示例#2
0
文件: capture.py 项目: klb3713/BYSJ
    def CaptureUser(self):
        start = time.time()
        print "[%s]Starting Capture User !" %(datetime.now())
        while not self.thread_stop:
            api = Api.objects.first()
            if api:
                api_processor = ApiProcessor(api, key='default')
                api_processor.start()
                api.delete()
#                self.sleep_count = 0
#            else:
#                self.sleep_count += 1
#            if self.sleep_count == 7:
#                print "[%s]All UserApi is processed!" %(datetime.now())
#                self.thread_stop = True
            time.sleep(self.interval)
            
        print "CaptureUser Use Time: %s" % (time.time() - start)