Skip to content

Commit 9ac7f1c

Browse files
Add cache clear function for thrasing the cache
1 parent 963b9c2 commit 9ac7f1c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

conditional/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
from conditional.blueprints.member_management import member_management_bp
2626
from conditional.blueprints.slideshow import slideshow_bp
2727

28+
from conditional.util.ldap import ldap_get_housing_points
29+
from conditional.util.ldap import ldap_get_active_members
30+
from conditional.util.ldap import ldap_get_intro_members
31+
from conditional.util.ldap import ldap_get_non_alumni_members
32+
from conditional.util.ldap import ldap_get_onfloor_members
33+
from conditional.util.ldap import ldap_get_current_students
34+
from conditional.util.ldap import ldap_get_name
35+
2836
app.register_blueprint(dashboard_bp)
2937
app.register_blueprint(attendance_bp)
3038
app.register_blueprint(major_project_bp)
@@ -49,6 +57,15 @@ def static_proxy(path):
4957
def default_route():
5058
return redirect('/dashboard')
5159

60+
@app.route('/clearcache')
61+
def clear_cache():
62+
ldap_get_housing_points.cache_clear()
63+
ldap_get_active_members.cache_clear()
64+
ldap_get_intro_members.cache_clear()
65+
ldap_get_non_alumni_members.cache_clear()
66+
ldap_get_onfloor_members.cache_clear()
67+
ldap_get_current_students.cache_clear()
68+
ldap_get_name.cache_clear()
5269

5370
@app.cli.command()
5471
def zoo():

0 commit comments

Comments
 (0)