Skip to content

Commit

Permalink
Fix double uploads for non default files if room is too slow to create
Browse files Browse the repository at this point in the history
  • Loading branch information
LoanR committed Jun 7, 2024
1 parent 015f1a1 commit 85ccf90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 8 additions & 2 deletions web/b3desk/models/bbb.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ def create(self):
data = self.bbb_response(request)

# non default files are sent later
if self.meeting.non_default_files:
if (
self.meeting.non_default_files
and "returncode" in data
and data["returncode"] == "SUCCESS"
):
xml = self.meeting_file_addition_xml(self.meeting.non_default_files)
request = self.bbb_request(
"insertDocument", params={"meetingID": self.meeting.meetingID}
Expand Down Expand Up @@ -320,7 +324,9 @@ def meeting_file_addition_xml(self, meeting_files):
f"{current_app.config['SECRET_KEY']}-0-{meeting_file.id}-{current_app.config['SECRET_KEY']}".encode()
).hexdigest()
current_app.logger.info(
"Add document on BigBLueButton room creation for file %s",
"Add document on BigBLueButton room %s %s creation for file %s",
self.meeting.name,
self.meeting.id,
meeting_file.title,
)
url = url_for(
Expand Down
3 changes: 3 additions & 0 deletions web/b3desk/models/meetings.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ def get_join_url(
not is_meeting_available and (meeting_role == Role.moderator) and create
)
if should_create_room:
current_app.logger.info(
"Request BBB room creation %s %s", self.name, self.id
)
data = self.create_bbb()
if "returncode" in data and data["returncode"] == "SUCCESS":
is_meeting_available = True
Expand Down

0 comments on commit 85ccf90

Please sign in to comment.