Skip to content

Commit ae3e546

Browse files
committed
Clear up the cleared flag on packages
1 parent 4854b77 commit ae3e546

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

aikido_zen/background_process/cloud_connection_manager/send_heartbeat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def send_heartbeat(connection_manager):
1717
routes = list(connection_manager.routes)
1818
outgoing_domains = connection_manager.hostnames.as_array()
1919
ai_stats = connection_manager.ai_stats.get_stats()
20-
packages = PackagesStore.get_packages()
20+
packages = PackagesStore.export()
2121

2222
connection_manager.statistics.clear()
2323
connection_manager.users.clear()

aikido_zen/background_process/packages.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def is_version_supported(version, required_version):
5959

6060
class PackagesStore:
6161
@staticmethod
62-
def get_packages():
62+
def export():
6363
global packages
6464
result = []
6565
for package in packages.values():
@@ -88,6 +88,9 @@ def get_package(package_name):
8888

8989
@staticmethod
9090
def clear():
91+
# To clear we set the `cleared` attribute to True
92+
# This is to ensure you can still get the packages
93+
# But that they will not show up during an export
9194
global packages
9295
for package in packages:
9396
packages[package]["cleared"] = True

aikido_zen/thread/thread_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def renew(self):
6565
"users": self.users.as_array(),
6666
"stats": self.stats.get_record(),
6767
"ai_stats": self.ai_stats.get_stats(),
68-
"packages": PackagesStore.get_packages(),
68+
"packages": PackagesStore.export(),
6969
},
7070
receive=True,
7171
)

0 commit comments

Comments
 (0)