diff --git a/src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py b/src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py index 0af4bc26d040..f9b5993fd1f9 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py +++ b/src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py @@ -16,6 +16,9 @@ def __init__(self): 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)