def valid(self):
if self.finished is not None:<EOL><INDENT>return False<EOL><DEDENT>with self._db_conn() as conn:<EOL><INDENT>row = conn.get('''<STR_LIT>''' % self._queue.table_name,<EOL>now=datetime.utcnow(),<EOL>ttl=self._queue.execution_ttl,<EOL>task_id=self.task_id,<EOL>execution_id=self.execution_id)<EOL><DEDENT>return bool(row is not None and row.valid)<EOL>
Check to see if we are still active.