示例#1
0
def refresh_menu(req, cfg_timestamp):
    """ refresh menu from db if timestamp is change """
    global timestamp
    global static_menu

    check = check_timestamp(req, cfg_timestamp)
    if check > timestamp:  # if last load was in past to timestamp file
        req.log_error("file timestamp is older, loading menu from DB...", state.LOG_INFO)
        static_menu = MenuItem.get_menu(req)
        timestamp = check