Skip to content

Commit

Permalink
add fix for key not exists case (#12769)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaiMR authored and StormLiangMS committed Dec 10, 2022
1 parent fdf84c8 commit 382243b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 382243b

Please sign in to comment.