Skip to content

Commit

Permalink
fix ReplayCache and ReplayDir double counting replays sometimes (for …
Browse files Browse the repository at this point in the history
…real)
  • Loading branch information
tybug committed May 26, 2020
1 parent 7ca1704 commit da9d624
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v4.2.2

* fix ``ReplayCache`` and ``ReplayDir`` double counting replays sometimes (for real this time)

# v4.2.1

* fix ``ReplayCache`` and ``ReplayDir`` double counting replays sometimes
Expand Down
4 changes: 4 additions & 0 deletions circleguard/loadable.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ def __init__(self, path, num_maps, num_replays):
self.cursor = conn.cursor()

def load_info(self, loader):
if self.info_loaded:
return
map_ids = self.cursor.execute(
"""
SELECT DISTINCT map_id
Expand Down Expand Up @@ -523,6 +525,8 @@ def __init__(self, dir_path, cache=None):
self.replays = []

def load_info(self, loader):
if self.info_loaded:
return
for path in os.listdir(self.dir_path):
if not path.endswith(".osr"):
continue
Expand Down
2 changes: 1 addition & 1 deletion circleguard/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "4.2.1"
__version__ = "4.2.2"

0 comments on commit da9d624

Please sign in to comment.