Flask/Dash application running as a service in windows must be restarted every day to include the current day’s date. How to solve the problem?

Solution
dcc.DatePickerSingle(id='previ_date',
    min_date_allowed=datetime.date(2022, 5, 10),
    max_date_allowed=None,
    initial_visible_month=None,
    date=datetime.date.today())


@app.callback([Output("previ_date", "max_date_allowed"), Output("previ_date", "initial_visible_month")],
                [Input("previ_date", "max_date_allowed"), Input("previ_date", "initial_visible_month")])

def update_date(max_date, current_month):
    if max_date==None:
        max_date=datetime.date.today()
    if current_month==None:
        current_month=datetime.date.today()
    return max_date, current_month