memsql/common/sql_step_queue/task_handler.py
def ping(self):
        """ Notify the queue that this task is still active. """
        if self.finished is not None:
            raise AlreadyFinished()

        with self._db_conn() as conn:
            success = conn.query('''
                UPDATE %s
                SET
                    last_contact=%%(now)s,
                    update_count=update_count + 1
                WHERE
                    id = %%(task_id)s
                    AND execution_id = %%(execution_id)s
                    AND last_contact > %%(now)s - INTERVAL %%(ttl)s SECOND
            ''' % self._queue.table_name,
                now=datetime.utcnow(),
                task_id=self.task_id,
                execution_id=self.execution_id,
                ttl=self._queue.execution_ttl)

        if success != 1:
            raise TaskDoesNotExist()
def ping(self):
        """ Notify the queue that this task is still active. """
        if self.finished is not None:
            raise AlreadyFinished()

        with self._db_conn() as conn:
            success = conn.query('''
                UPDATE %s
                SET
                    last_contact=%%(now)s,
                    update_count=update_count + 1
                WHERE
                    id = %%(task_id)s
                    AND execution_id = %%(execution_id)s
                    AND last_contact > %%(now)s - INTERVAL %%(ttl)s SECOND
            ''' % self._queue.table_name,
                now=datetime.utcnow(),
                task_id=self.task_id,
                execution_id=self.execution_id,
                ttl=self._queue.execution_ttl)

        if success != 1:
            raise TaskDoesNotExist()
def ping ( self ) : if self . finished is not None : raise AlreadyFinished ( ) with self . _db_conn ( ) as conn : success = conn . query ( '''
                UPDATE %s
                SET
                    last_contact=%%(now)s,
                    update_count=update_count + 1
                WHERE
                    id = %%(task_id)s
                    AND execution_id = %%(execution_id)s
                    AND last_contact > %%(now)s - INTERVAL %%(ttl)s SECOND
            ''' % self . _queue . table_name , now = datetime . utcnow ( ) , task_id = self . task_id , execution_id = self . execution_id , ttl = self . _queue . execution_ttl ) if success != 1 : raise TaskDoesNotExist ( )
Notify the queue that this task is still active.
Notify the queue that this task is still active .