Clear NS1 zone cache before record cache

This commit is contained in:
Ross McFarland
2021-08-23 17:53:07 -07:00
parent efdb4866c0
commit aa88b877c4
+6 -4
View File
@@ -205,10 +205,11 @@ class Ns1Client(object):
def records_delete(self, zone, domain, _type):
try:
# remove record from cache
del self._records_cache[zone][domain][_type]
# remove record's zone from cache
del self._zones_cache[zone]
# remove record from cache, after zone since we may not have
# fetched the record details
del self._records_cache[zone][domain][_type]
except KeyError:
# never mind if record is not found in cache
pass
@@ -224,10 +225,11 @@ class Ns1Client(object):
def records_update(self, zone, domain, _type, **params):
try:
# remove record from cache
del self._records_cache[zone][domain][_type]
# remove record's zone from cache
del self._zones_cache[zone]
# remove record from cache, after zone since we may not have
# fetched the record details
del self._records_cache[zone][domain][_type]
except KeyError:
# never mind if record is not found in cache
pass