(self)
return 1
Do the work loop, once (internal).
        Returns: true if wants to be called again,
        false if script can sleep.
Do the work loop, once (internal).
        Returns: true if wants to be called again,
        false if script can sleep.
Do the work loop once ( internal ) . Returns : true if wants to be called again false if script can sleep .
def work(self):
        """Do the work loop, once (internal).
        Returns: true if wants to be called again,
        false if script can sleep.
        """

        db = self.get_database(self.db_name)
        curs = db.cursor()

        self.stat_start()

        # acquire batch
        batch_id = self._load_next_batch(curs)
        db.commit()
        if batch_id == None:
            return 0

        # load events
        ev_list = self._load_batch_events(curs, batch_id)
        db.commit()

        # process events
        self._launch_process_batch(db, batch_id, ev_list)

        # done
        self._finish_batch(curs, batch_id, ev_list)
        db.commit()
        self.stat_end(len(ev_list))

        return 1
def work ( self ) : db = self . get_database ( self . db_name ) curs = db . cursor ( ) self . stat_start ( ) # acquire batch batch_id = self . _load_next_batch ( curs ) db . commit ( ) if batch_id == None : return 0 # load events ev_list = self . _load_batch_events ( curs , batch_id ) db . commit ( ) # process events self . _launch_process_batch ( db , batch_id , ev_list ) # done self . _finish_batch ( curs , batch_id , ev_list ) db . commit ( ) self . stat_end ( len ( ev_list ) ) return 1