Skip to content

Commit

Permalink
Fix unprocessed count
Browse files Browse the repository at this point in the history
Potentially resolves #81.
This second fix implements:
#81 (comment)
  • Loading branch information
greenstatic committed Jul 9, 2022
1 parent 54e26b6 commit 6e2a6ea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions bbb-exporter/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,21 @@ def recordings_deleted_from_disk(bigbluebutton_base_dir) -> int:

def recordings_unprocessed_from_disk(bigbluebutton_base_dir) -> int:
# bigbluebutton_base_dir i.e. "/var/bigbluebutton/"
path = os.path.join(bigbluebutton_base_dir, "recording/status/recorded")
sanity = 0
processed = 0

path = os.path.join(bigbluebutton_base_dir, "recording/status/sanity")
try:
return len(os.listdir(path=path))
sanity = len(os.listdir(path=path))
except FileNotFoundError:
logging.info("Path %s doesn't exist, setting unprocessed recordings to 0", path)
return 0

path = os.path.join(bigbluebutton_base_dir, "recording/status/processed")
try:
processed = len(os.listdir(path=path))
except FileNotFoundError:
logging.info("Path %s doesn't exist, setting unprocessed recordings to 0", path)
return 0

return sanity - processed
2 changes: 1 addition & 1 deletion bbb-exporter/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
MAJOR = 0
MINOR = 7
BUGFIX = 1
INFO = "preview1"
INFO = "preview2"

VERSION = "{}.{}.{}".format(MAJOR, MINOR, BUGFIX)
if INFO:
Expand Down

0 comments on commit 6e2a6ea

Please sign in to comment.