def lookup(): if len(lookup_pool) == 0: return for ut in UserThread.all().filter('thread_id IN', lookup_pool): last_viewed[ut.thread_id] = ut.last_viewed del lookup_pool[:]