add fix for key not exists case (#12769)

This commit is contained in:
jcaiMR 2022-11-20 20:20:31 +08:00 committed by GitHub
parent 1302a31eee
commit bc174c686c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,9 @@ class StaticRouteTimer(object):
def set_timer(self):
""" Check for custom route expiry time in STATIC_ROUTE:EXPIRY_TIME """
keys = self.db.keys(self.db.APPL_DB, "STATIC_ROUTE_EXPIRY_TIME")
if len(keys) == 0:
return
timer = self.db.get(self.db.APPL_DB, "STATIC_ROUTE_EXPIRY_TIME", "time")
if timer is not None:
timer = int(timer)