Revision ca6bb3d5 utils/proxy.py

b/utils/proxy.py
38 38
    
39 39
    def fetch_device(self):
40 40
        device = cache.get("device")
41
        logger.info("[CACHE] hit! got device")
41 42
        if device:
42 43
            return device
43 44
        else:
44 45
            device = self.proccess_xml()
45 46
            if device.routing_options:
46
                cache.set("device", device)
47
                cache.set("device", device, 3600)
48
                logger.info("[CACHE] miss, setting device")
47 49
                return device
48 50
            else:
49 51
                return False
......
188 190
                                    logger.info("Successfully committed @ %s" % self.device)
189 191
                                    newconfig = m.get_config(source='running', filter=('subtree',settings.ROUTES_FILTER)).data_xml
190 192
                                    retrieve = Retriever(xml=newconfig)
191
                                    cache.set("device", retrieve.proccess_xml())
193
                                    logger.info("[CACHE] caching device configuration")
194
                                    cache.set("device", retrieve.proccess_xml(), 3600)
192 195
                                    
193 196
                                    if not commit_is_successful:
194 197
                                        raise Exception()

Also available in: Unified diff