I am facing an issue where the Dash app encounters an error and then, instead of stopping and exiting, it restarts the program once and fails again. It waits indefinitely after this:
2020-05-26 15:31:57 PM INFO ********** PROCESS START **********
2020-05-26 15:32:01 PM ERROR Error: SQL error
2020-05-26 15:32:03 PM INFO ********** PROCESS START **********
2020-05-26 15:32:04 PM ERROR Error: SQL error
This is the part of the code that is being called inside the Dash app:
pyodbc.pooling = False with pyodbc.connect(connection, autocommit=True) as conn: conn.setdecoding(pyodbc.SQL_CHAR, encoding='utf-8') conn.setdecoding(pyodbc.SQL_WCHAR, encoding='utf-8') conn.setencoding(encoding='utf-8') try: df_help = pd.read_sql(sql_col_list, conn, index_col = 'ColumnName',parse_dates=['CreateTimeStamp', 'LastAlterTimeStamp']) df_counts = pd.read_sql(pull_header_counts(df_help), conn) except: logging.error('Error: SQL error') sys.exit()
Even though I have given sys.exit() it does not exit the execution. It starts the execution all over again and then fails again. Then it hangs (waits indefinitely).
This is happening even though I have mentioned use_reloader = False and debug=False but to no avail:
app.layout = app_layout()
if name == ‘main’:
app.run_server(debug=False, use_reloader=False, port=8080)
Could you tell me how to avoid restarting the program?