def process_datamap(self, pipe, positions): grids = set() for lat, lon in positions: if lat is not None and lon is not None: grids.add(DataMap.scale(lat, lon)) shards = defaultdict(set) for lat, lon in grids: shards[DataMap.shard_id(lat, lon)].add(encode_datamap_grid(lat, lon)) for shard_id, values in shards.items(): queue = self.task.app.data_queues['update_datamap_' + shard_id] queue.enqueue(list(values), pipe=pipe)
def process_datamap(self, pipe, positions): grids = set() for lat, lon in positions: if lat is not None and lon is not None: grids.add(DataMap.scale(lat, lon)) shards = defaultdict(set) for lat, lon in grids: shards[DataMap.shard_id(lat, lon)].add( encode_datamap_grid(lat, lon)) for shard_id, values in shards.items(): queue = self.task.app.data_queues['update_datamap_' + shard_id] queue.enqueue(list(values), pipe=pipe)