Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python-bigbluebutton2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Grupp
python-bigbluebutton2
Commits
9bacd4e8
Verified
Commit
9bacd4e8
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Cache meeting and session data betweens runs
parent
756eb1dc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bigbluebutton/api/bigbluebutton.py
+23
-3
23 additions, 3 deletions
bigbluebutton/api/bigbluebutton.py
with
23 additions
and
3 deletions
bigbluebutton/api/bigbluebutton.py
+
23
−
3
View file @
9bacd4e8
...
@@ -69,6 +69,7 @@ class BigBlueButton:
...
@@ -69,6 +69,7 @@ class BigBlueButton:
sysstat
:
Optional
[
SadfReport
]
=
field
(
default
=
None
,
init
=
False
,
compare
=
False
)
sysstat
:
Optional
[
SadfReport
]
=
field
(
default
=
None
,
init
=
False
,
compare
=
False
)
request_timeout
:
Union
[
float
,
Tuple
[
float
,
float
]]
=
field
(
default
=
(
0.5
,
10
),
compare
=
False
)
request_timeout
:
Union
[
float
,
Tuple
[
float
,
float
]]
=
field
(
default
=
(
0.5
,
10
),
compare
=
False
)
cache_timeout
:
float
=
field
(
default
=
30
,
compare
=
False
)
def
__post_init__
(
self
):
def
__post_init__
(
self
):
"""
Set up the server object to work properly.
"""
Set up the server object to work properly.
...
@@ -80,7 +81,15 @@ class BigBlueButton:
...
@@ -80,7 +81,15 @@ class BigBlueButton:
logger
.
debug
(
f
"
Self-registered server
{
self
.
name
}
in group
{
self
.
group
.
name
}
"
)
logger
.
debug
(
f
"
Self-registered server
{
self
.
name
}
in group
{
self
.
group
.
name
}
"
)
# Use persistent HTTP session to track JSESSIONID cookie (et al)
# Use persistent HTTP session to track JSESSIONID cookie (et al)
self
.
_session
=
requests
.
Session
()
self
.
_session
=
cache
.
get
(
f
"
{
self
.
url
}
::session
"
)
or
requests
.
Session
()
# Restore meeting data from last time if any
self
.
meetings
=
cache
.
get
(
f
"
{
self
.
url
}
::meetings
"
)
or
{}
def
__del__
(
self
):
"""
Store meeting and session data for next time.
"""
cache
.
set
(
f
"
{
self
.
url
}
::meetings
"
,
self
.
meetings
,
self
.
cache_timeout
)
cache
.
set
(
f
"
{
self
.
url
}
::session
"
,
self
.
_session
,
self
.
cache_timeout
)
@staticmethod
@staticmethod
def
request_checksum
(
call
:
str
,
query
:
str
,
salt
:
str
)
->
str
:
def
request_checksum
(
call
:
str
,
query
:
str
,
salt
:
str
)
->
str
:
...
@@ -304,7 +313,7 @@ class BigBlueButtonGroup:
...
@@ -304,7 +313,7 @@ class BigBlueButtonGroup:
:param origin: Name of the origin software passed as meeting meta-data
:param origin: Name of the origin software passed as meeting meta-data
:param origin_server_name: Hostname of the origin, passed as meeting meta-data;
:param origin_server_name: Hostname of the origin, passed as meeting meta-data;
defaults to the systems
'
s local FQDN
defaults to the systems
'
s local FQDN
:param generate_meeting_id: Callable to run for generating meeting IDs
:param generate_meeting_id
_cb
: Callable to run for generating meeting IDs
"""
"""
name
:
str
name
:
str
...
@@ -316,7 +325,18 @@ class BigBlueButtonGroup:
...
@@ -316,7 +325,18 @@ class BigBlueButtonGroup:
origin
:
str
=
"
python-bigbluebutton2
"
origin
:
str
=
"
python-bigbluebutton2
"
origin_server_name
:
str
=
field
(
default_factory
=
getfqdn
)
origin_server_name
:
str
=
field
(
default_factory
=
getfqdn
)
generate_meeting_id
:
Callable
[[],
str
]
=
field
(
default
=
lambda
:
str
(
uuid1
()),
compare
=
False
)
generate_meeting_id_cb
:
Optional
[
Callable
[[],
str
]]
=
field
(
default
=
None
,
compare
=
False
)
def
generate_meeting_id
(
self
)
->
str
:
"""
Generate a unique meeting ID.
By default, this returns a GUID, unless a callback was defined in the
`generate_meeting_id_cb` attribute.
"""
if
self
.
generate_meeting_id_cb
is
None
:
return
str
(
uuid1
())
else
:
return
self
.
generate_meeting_id_cb
()
@property
@property
def
meetings
(
self
)
->
Dict
[
str
,
"
Meeting
"
]:
def
meetings
(
self
)
->
Dict
[
str
,
"
Meeting
"
]:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment