Пример #1
0
class SendMailController(BaseController):
    
    def __init__(self):
        self.utility = Utility();
        self.urlUtility = URLUtility();
        dh = LogDBHandler( config=config,request=request);
        log.addHandler(dh)
        
         
        self.thread1 = DoCheckin(limit=100,offset=0 );
    
    @expose('json')    
    def send(self):
        
        reload(sys).setdefaultencoding("utf-8");
        
        print ("Start send Mail");
        
        print "isAlive : " + str(self.thread1.isAlive());
        if (not self.thread1.isAlive() ):
            print "start thread"
            self.thread1 = DoCheckin(limit=100,offset=0 );
            self.thread1.start()
        
        #time.sleep(15)
        #thread1.setLoop = False
        dict(message="thread send volunteer is started");
        
    @expose('json')
    def stop (self):
        self.thread1.setLoop = False
        print "exit"
        dict(message="thread send volunteer is stop");
Пример #2
0
 def __init__(self):
     self.utility = Utility();
     self.urlUtility = URLUtility();
     dh = LogDBHandler( config=config,request=request);
     log.addHandler(dh)
     
      
     self.thread1 = DoCheckin(limit=100,offset=0 );
Пример #3
0
 def send(self):
     
     reload(sys).setdefaultencoding("utf-8");
     
     print ("Start send Mail");
     
     print "isAlive : " + str(self.thread1.isAlive());
     if (not self.thread1.isAlive() ):
         print "start thread"
         self.thread1 = DoCheckin(limit=100,offset=0 );
         self.thread1.start()
     
     #time.sleep(15)
     #thread1.setLoop = False
     dict(message="thread send volunteer is started");