reach-vb HF staff annasun28 commited on
Commit
1185af0
1 Parent(s): 90d7761

Update seamless_server/app_pubsub.py (#6)

Browse files

- Update seamless_server/app_pubsub.py (24465af90f429ad3f7c786775b950ea3ed90bdf4)


Co-authored-by: Anna Sun <[email protected]>

Files changed (1) hide show
  1. seamless_server/app_pubsub.py +11 -10
seamless_server/app_pubsub.py CHANGED
@@ -497,18 +497,19 @@ async def join_room(sid, client_id, room_id_from_client, config_dict):
497
  ):
498
  # If something goes wrong and the server gets stuck in a locked state the client can
499
  # force the server to remove the lock by passing the special name ESCAPE_HATCH_SERVER_LOCK_RELEASE_NAME
500
- if (
501
- server_lock is not None
502
- and config_dict.get("lockServerName")
503
- == ESCAPE_HATCH_SERVER_LOCK_RELEASE_NAME
504
- ):
505
- server_lock = None
506
- logger.info(
507
- f"🔓 Server lock has been reset by {client_id} using the escape hatch name {ESCAPE_HATCH_SERVER_LOCK_RELEASE_NAME}"
508
- )
 
509
 
510
  # If the server is not locked, set a lock. If it's already locked to this client, update the lock object
511
- elif server_lock is None or server_lock.get("client_id") == client_id:
512
  # TODO: Add some sort of timeout as a backstop in case someone leaves the browser tab open after locking the server
513
  server_lock = {
514
  "name": config_dict.get("lockServerName"),
 
497
  ):
498
  # If something goes wrong and the server gets stuck in a locked state the client can
499
  # force the server to remove the lock by passing the special name ESCAPE_HATCH_SERVER_LOCK_RELEASE_NAME
500
+ # TEMP: remove escape hatch for demo
501
+ # if (
502
+ # server_lock is not None
503
+ # and config_dict.get("lockServerName")
504
+ # == ESCAPE_HATCH_SERVER_LOCK_RELEASE_NAME
505
+ # ):
506
+ # server_lock = None
507
+ # logger.info(
508
+ # f"🔓 Server lock has been reset by {client_id} using the escape hatch name {ESCAPE_HATCH_SERVER_LOCK_RELEASE_NAME}"
509
+ # )
510
 
511
  # If the server is not locked, set a lock. If it's already locked to this client, update the lock object
512
+ if server_lock is None or server_lock.get("client_id") == client_id:
513
  # TODO: Add some sort of timeout as a backstop in case someone leaves the browser tab open after locking the server
514
  server_lock = {
515
  "name": config_dict.get("lockServerName"),