From 003fa038119c6b07ab906cc116a6a4ec6fa050b0 Mon Sep 17 00:00:00 2001 From: Kumi Date: Wed, 13 Nov 2024 14:45:53 +0100 Subject: [PATCH] feat(init-data): add p2pool and daily data updates Enhanced the data initialization process to include p2pool and daily data updates, improving the comprehensiveness of data management. With this change, more data components are maintained accurately, addressing potential omissions in daily operations. This helps ensure up-to-date information is available for analysis. --- app/charts/management/commands/initialize_data.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/charts/management/commands/initialize_data.py b/app/charts/management/commands/initialize_data.py index d17d796..3c21f42 100644 --- a/app/charts/management/commands/initialize_data.py +++ b/app/charts/management/commands/initialize_data.py @@ -30,5 +30,18 @@ class Command(BaseCommand): try: self.stdout.write(self.style.SUCCESS(f"Updating {coin} data")) get_history_function(coin) + except Exception as e: self.stdout.write(self.style.ERROR(f"Error with {coin}: {e}")) + + try: + self.stdout.write(self.style.SUCCESS("Updating p2pool data")) + update_p2pool() + except Exception as e: + self.stdout.write(self.style.ERROR(f"Error updating p2pool data: {e}")) + + try: + self.stdout.write(self.style.SUCCESS("Updating daily data")) + update_database() + except Exception as e: + self.stdout.write(self.style.ERROR(f"Error updating daily data: {e}")) \ No newline at end of file