Changeset 302 for trunk/packages
- Timestamp:
- Mar 28, 2008, 10:19:05 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-dns/code/dnsserver.py
r300 r302 8 8 9 9 import sipb_xen_database 10 import psycopg2 11 import sqlalchemy 12 import time 10 13 11 14 class DatabaseAuthority(common.ResolverBase): … … 24 27 expire=3600000, minimum=21600, ttl=3600) 25 28 def _lookup(self, name, cls, type, timeout = None): 29 for i in range(3): 30 try: 31 value = self._lookup_unsafe(name, cls, type, timeout = None) 32 except (psycopg2.OperationalError, sqlalchemy.exceptions.SQLError): 33 if i == 2: 34 raise 35 print "Reloading database" 36 time.sleep(0.5) 37 continue 38 else: 39 return value 40 41 def _lookup_unsafe(self, name, cls, type, timeout): 26 42 sipb_xen_database.clear_cache() 27 43 if not (name.lower() == self.domain or
Note: See TracChangeset
for help on using the changeset viewer.