Spaces:
Build error
Build error
Commit
·
f27e7ee
1
Parent(s):
847e941
fix api
Browse files
app.py
CHANGED
|
@@ -269,7 +269,7 @@ def get_proxy_api():
|
|
| 269 |
proxies = get_system_proxies()
|
| 270 |
return jsonify({"proxies": proxies})
|
| 271 |
|
| 272 |
-
@app.route('/api/size', methods=['GET'])
|
| 273 |
def get_cache_size_api():
|
| 274 |
total_size = 0
|
| 275 |
for dirpath, dirnames, filenames in os.walk(CACHE_DIR):
|
|
@@ -279,7 +279,7 @@ def get_cache_size_api():
|
|
| 279 |
readable_size = bytes_to_human_readable(total_size)
|
| 280 |
return jsonify({"cache_size": readable_size})
|
| 281 |
|
| 282 |
-
@app.route('/api/
|
| 283 |
def clear_cache_api():
|
| 284 |
for dirpath, dirnames, filenames in os.walk(CACHE_DIR):
|
| 285 |
for f in filenames:
|
|
|
|
| 269 |
proxies = get_system_proxies()
|
| 270 |
return jsonify({"proxies": proxies})
|
| 271 |
|
| 272 |
+
@app.route('/api/cache/size', methods=['GET'])
|
| 273 |
def get_cache_size_api():
|
| 274 |
total_size = 0
|
| 275 |
for dirpath, dirnames, filenames in os.walk(CACHE_DIR):
|
|
|
|
| 279 |
readable_size = bytes_to_human_readable(total_size)
|
| 280 |
return jsonify({"cache_size": readable_size})
|
| 281 |
|
| 282 |
+
@app.route('/api/cache/clear', methods=['POST'])
|
| 283 |
def clear_cache_api():
|
| 284 |
for dirpath, dirnames, filenames in os.walk(CACHE_DIR):
|
| 285 |
for f in filenames:
|