cache_clear()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 11
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 1
nop 0
1
"""
2
Chalice Routen für Caching
3
"""
4
5
__author__ = "Glücks GmbH - Frederik Glücks"
6
__email__ = "[email protected]"
7
__copyright__ = "Frederik Glücks - Glücks GmbH"
8
9
# Generic/Built-in Imports
10
11
# External libs/modules
12
from chalice import Blueprint
13
14
# Own libs/modules
15
from luckywood import DataCaching
16
17
18
data_caching_routes = Blueprint(__name__)
19
20
21
@data_caching_routes.route('/cache', methods=['DELETE'])
22
def cache_clear():
23
    """
24
    Clear the complete data cache and returns the number of
25
    deleted objects
26
27
    :return: json
28
    """
29
30
    return {
31
        "cleared": DataCaching.clear()
32
    }
33
34
35
@data_caching_routes.route('/cache', methods=['GET'])
36
def get_cache_statistic():
37
    """
38
    Returns a statistic of cached objects
39
40
    :return: json
41
    """
42
    return DataCaching.get_statistic()
43