def updateInfo(self, item, newlinks, oldlinks):
		'''爬虫爬完之后对数据库内容进行更新'''
		cur = self.conn.cursor()
		cur.execute("SELECT wid,did FROM Websites WHERE url=?", (item['url'],))
		wid, did = cur.fetchone()
		# website记录更新
		cur.execute("UPDATE Websites SET title=?,visited=1 WHERE wid=?", (item['title'], wid,))
		# 对应的domain记录中出度也需要更新
		cur.execute("UPDATE Domains SET outdegree=outdegree+? WHERE did=?", (len(item['links']), did,))

		# 对该网页中所有链接涉及的记录进行更新
		# 外部判断未出现过的链接
		for link,domain in newlinks:
			self.insertWebsite(link, domain)

		# 外部判断出现过的链接
		for link,domain in oldlinks:
			# 对对应的domain记录入度增加
			cur.execute("UPDATE Domains SET outdegree=outdegree+1 WHERE domain=?", (domain,))
		# 写入到文件
		self.conn.commit()
def wait_for_snapshot_status(self, snapshot_id, status):
        """Waits for a Snapshot to reach a given status."""
        start_time = time.time()
        old_value = value = self._get_snapshot_status(snapshot_id)
        while True:
            dtime = time.time() - start_time
            time.sleep(self.build_interval)
            if value != old_value:
                LOG.info('Value transition from "%s" to "%s"'
                         'in %d second(s).', old_value,
                         value, dtime)
            if (value == status):
                return value

            if dtime > self.build_timeout:
                message = ('Time Limit Exceeded! (%ds)'
                           'while waiting for %s, '
                           'but we got %s.' %
                           (self.build_timeout, status, value))
                raise exceptions.TimeoutException(message)
            time.sleep(self.build_interval)
            old_value = value
            value = self._get_snapshot_status(snapshot_id)