JVice commited on
Commit
c842111
1 Parent(s): 59712d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -83,16 +83,17 @@ def user_login_create():
83
  global TBYB_LOGO
84
  global USER_LOGGED_IN
85
  users = None
86
- with open(USER_DATABASE_PATH) as file:
87
- users = yaml.load(file, Loader=SafeLoader)
88
- AUTHENTICATOR = stauth.Authenticate(
89
- users['credentials'],
90
- users['cookie']['name'],
91
- users['cookie']['key'],
92
- users['cookie']['expiry_days'],
93
- users['preauthorized']
94
- )
95
-
 
96
  with st.sidebar:
97
  st.image(TBYB_LOGO, width=70)
98
  loginTab, registerTab, detailsTab = st.tabs(["Log in", "Register", "Account details"])
 
83
  global TBYB_LOGO
84
  global USER_LOGGED_IN
85
  users = None
86
+ with USER_DATABASE_UPDATE_SCHEDULER.lock:
87
+ with open(USER_DATABASE_PATH) as file:
88
+ users = yaml.load(file, Loader=SafeLoader)
89
+ AUTHENTICATOR = stauth.Authenticate(
90
+ users['credentials'],
91
+ users['cookie']['name'],
92
+ users['cookie']['key'],
93
+ users['cookie']['expiry_days'],
94
+ users['preauthorized']
95
+ )
96
+
97
  with st.sidebar:
98
  st.image(TBYB_LOGO, width=70)
99
  loginTab, registerTab, detailsTab = st.tabs(["Log in", "Register", "Account details"])