Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
fsmi-klausurarchiv
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
23
Issues
23
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
fsarbeit.imt
fsmi-klausurarchiv
Commits
cbcfb835
Commit
cbcfb835
authored
Sep 08, 2019
by
Dennis Baurichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search: ExistingFilter: Invalidate old cache
Fixes
#70
parent
681975c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
src/python/klausurarchiv/search/exams.py
src/python/klausurarchiv/search/exams.py
+5
-0
No files found.
src/python/klausurarchiv/search/exams.py
View file @
cbcfb835
...
...
@@ -83,6 +83,7 @@ class ExistingFilter:
# No additional arguments are required by this generator.
def
__init__
(
s
,
enumerator
):
s
.
_cache
=
None
s
.
_cache_epoch
=
caching
.
get_epoch
()
s
.
_enumerator
=
enumerator
## \brief Clears internal cache in this filter and all predecessors
...
...
@@ -93,10 +94,14 @@ class ExistingFilter:
## \brief Request method as specified in
# \ref _fn_99-meta_doc_concepts_search-engines_md.
def
request
(
s
,
**
kwargs
):
if
caching
.
get_epoch
()
>
s
.
_cache_epoch
:
s
.
invalidateCache
()
allItems
=
s
.
_enumerator
.
request
(
**
kwargs
)
if
s
.
_cache
==
None
:
s
.
_cache
=
set
()
s
.
_cache_epoch
=
caching
.
get_epoch
()
for
item
in
allItems
:
if
item
.
folder
.
archived
or
item
.
folder
.
lost
:
continue
s
.
_cache
.
add
(
item
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment