

def addToHeap(self, uuid, type):
    if (not (uuid in self.unscheduled_items)):
        if (interval.service_mapping and (type in self.service_mapping)):
            LOGGER.info(('Remapping resource %s to %s' % (type, self.service_mapping[type])))
            type = self.service_mapping[type]
        try:
            uuid_bytes = UUID(uuid).bytes
        except ValueError:
            LOGGER.error(('Cound not turn UUID into byes using string %s' % uuid))
            return
        if ((type in self.functions) and ('interval' in self.functions[type])):
            interval = int(self.functions[type]['interval'])
        else:
            LOGGER.error(('Could not find interval for type %s' % type))
            return
        enqueue_time = int((time.time() + interval))
        LOGGER.debug(('Adding %s to heap with time %s and interval of %s' % (uuid, enqueue_time, interval)))
        heappush(self.heap, (enqueue_time, (uuid_bytes, interval)))
    else:
        LOGGER.info(('Unscheduling %s' % uuid))
        self.unscheduled_items.remove(uuid)

dataset/ETHPy150Open wehriam/awspider/awspider/servers2/scheduler.py SchedulerServer.addToHeap/VarMisuse@30/39 `self`->`interval`