示例#1
0
 def init_btm_gather(self, topic, description, no_of_urls, *args, **kwargs):
     lock_name = 'job_handler_init_btm_%d' % self.job.id
     with POSIXLock(lock_name):
         if self.job.tagasaurisjobs.beatthemachine_hit is not None:
             log.info(
                 'Tried to create new btm gathering job, but it already exists'
             )
             return True
         tc = make_tagapi_client()
         key, hit = create_btm(tc, self.job, topic, description, no_of_urls)
         self.job.tagasaurisjobs.beatthemachine_key = key
         self.job.tagasaurisjobs.save()
         return key is not None
示例#2
0
 def init_btm_gather(self, topic, description, no_of_urls, *args, **kwargs):
     lock_name = 'job_handler_init_btm_%d' % self.job.id
     with POSIXLock(lock_name):
         if self.job.tagasaurisjobs.beatthemachine_hit is not None:
             log.info(
                 'Tried to create new btm gathering job, but it already exists'
             )
             return True
         tc = make_tagapi_client()
         key, hit = create_btm(tc, self.job, topic, description, no_of_urls)
         self.job.tagasaurisjobs.beatthemachine_key = key
         self.job.tagasaurisjobs.save()
         return key is not None
示例#3
0
 def testBTMCreation(self):
     btm_key, btm_hit = create_btm(self.tc, self.job, "topic",
                                   "description", 10)
     self.assertEqual(len(btm_hit), 32)
     self.assertEqual(len(btm_key), 32)
示例#4
0
 def testBTMCreation(self):
     btm_key, btm_hit = create_btm(self.tc, self.job, "topic",
         "description", 10)
     self.assertEqual(len(btm_hit), 32)
     self.assertEqual(len(btm_key), 32)