From 8a2032561c3b5ceae432e57ad594ba83226717a5 Mon Sep 17 00:00:00 2001
From: thomaswoehlke <thomas.woehlke@gmail.com>
Date: Tue, 25 May 2021 23:37:16 +0200
Subject: [PATCH] Refactoring: vaccination

---
 .../blueprints/data_owid/owid_service.py             | 12 ++++++++++--
 src/flask_covid19/blueprints/data_owid/owid_views.py |  1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/flask_covid19/blueprints/data_owid/owid_service.py b/src/flask_covid19/blueprints/data_owid/owid_service.py
index f80b3539..e236e006 100644
--- a/src/flask_covid19/blueprints/data_owid/owid_service.py
+++ b/src/flask_covid19/blueprints/data_owid/owid_service.py
@@ -50,11 +50,19 @@ class OwidService:
         return self
 
     def full_update_star_schema(self):
-        self.service_import.import_file()
         self.service_update_full.full_update_star_schema()
         return self
 
     def update_star_schema(self):
+        self.service_update.update_star_schema()
+        return self
+
+    def full_update(self):
+        self.service_import.import_file()
+        self.service_update_full.full_update_star_schema()
+        return self
+
+    def update(self):
         self.service_import.import_file()
         self.service_update.update_star_schema()
-        return self
\ No newline at end of file
+        return self
diff --git a/src/flask_covid19/blueprints/data_owid/owid_views.py b/src/flask_covid19/blueprints/data_owid/owid_views.py
index ff8edd93..a8735e0c 100644
--- a/src/flask_covid19/blueprints/data_owid/owid_views.py
+++ b/src/flask_covid19/blueprints/data_owid/owid_views.py
@@ -397,6 +397,7 @@ def task_owid_update_star_schema(self):
     return result
 
 
+@celery.task(bind=True)
 def task_owid_full_update(self):
     logger = get_task_logger(__name__)
     self.update_state(state=states.STARTED)
-- 
GitLab